- Move keyboard events as part of a separate class.

- TextEditor is now one instance peer node.
- Broken: f2 and start writting on typing.
This commit is contained in:
Paulo Veiga
2011-08-19 13:38:37 -03:00
parent 78f312ef0a
commit f3e024735d
22 changed files with 759 additions and 799 deletions

View File

@@ -25,6 +25,9 @@ mindplot.ScreenManager = new Class({
// Ignore default click event propagation. Prevent 'click' event on drad.
this._clickEvents = [];
this._divContainer.addEvent('click',function(event){event.stopPropagation()});
// @Todo: This must be resolved in other way ...
mindplot.util.Converter.setScreenManager(this);
},
setScale : function(scale) {
@@ -59,7 +62,7 @@ mindplot.ScreenManager = new Class({
},
getWorkspaceElementPosition : function(e) {
// Retrive current element position.
// Retrieve current element position.
var elementPosition = e.getPosition();
var x = elementPosition.x;
var y = elementPosition.y;
@@ -68,16 +71,10 @@ mindplot.ScreenManager = new Class({
x = x - this._offset.x;
y = y - this._offset.y;
// Scale coordinate in order to be relative to the workspace. That's coordSize/size;
// Scale coordinate in order to be relative to the workspace. That's coord/size;
x = x / this._workspaceScale;
y = y / this._workspaceScale;
// Subtract div position.
/* var containerElem = this.getContainer();
var containerPosition = core.Utils.workOutDivElementPosition(containerElem);
x = x + containerPosition.x;
y = y + containerPosition.y;*/
// Remove decimal part..
return {x:x,y:y};
},