fixing text edition problems

This commit is contained in:
Pablo Luna 2011-03-29 17:06:59 +01:00
parent 9a0de7ed21
commit f8fa8b2b37
3 changed files with 21 additions and 4 deletions

View File

@ -91,6 +91,7 @@ mindplot.MindmapDesigner.prototype._registerEvents = function()
// Create nodes on double click...
screenManager.addEventListener('click', function(event)
{
var t = mindmapDesigner.getEditor()._isVisible();
mindmapDesigner.getEditor().lostFocus();
// @todo: Puaj hack...
mindmapDesigner._cleanScreen();

View File

@ -68,6 +68,7 @@ mindplot.TextEditor = function(screenManager,actionRunner)
};
//Register onLostFocus/onBlur event
$(this.inputText).addEvent('blur', this.lostFocusEvent.bind(this));
$(this.inputText).addEvent('click', this.clickEvent.bindWithEvent(this));
var elem = this;
@ -98,6 +99,7 @@ mindplot.TextEditor.prototype.lostFocusEvent = function ()
{
this.fx.options.duration = 10;
this.fx.start(1, 0);
designer.getWorkSpace().enableWorkspaceEvents(true);
//myAnim.animate();
};
@ -386,3 +388,17 @@ mindplot.TextEditor.prototype.lostFocus = function(bothBrowsers)
}
};
mindplot.TextEditor.prototype.clickEvent = function(event){
designer.getWorkSpace().enableWorkspaceEvents(false);
if(this._isVisible()){
if (event.stopPropagation)
{
event.stopPropagation(true);
} else
{
event.cancelBubble = true;
}
}
event.preventDefault();
};

View File

@ -94,11 +94,11 @@ mindplot.layoutManagers.OriginalLayoutManager = mindplot.layoutManagers.BaseLayo
dragger.add(topic);
}
/*// Register editor events ...
if (!this._viewMode)
// Register editor events ...
if (!this.getDesigner()._viewMode)
{
this._editor.listenEventOnNode(topic, 'dblclick', true);
}*/
this.getDesigner()._editor.listenEventOnNode(topic, 'dblclick', true);
}
},
_createMainTopicBoard:function(node){