TextEditor is positioned based on mootools functions.

This commit is contained in:
Paulo Veiga
2011-08-23 20:56:01 -03:00
parent fb39e32b33
commit 1f5dbfb5d2
6 changed files with 12 additions and 27 deletions

View File

@@ -66,7 +66,7 @@ mindplot.BidirectionalArray = new Class({
},
get :function(index, sign) {
$assert(index, 'Illegal argument, index must be passed.');
$assert($defined(index), 'Illegal argument, index must be passed.');
if ($defined(sign)) {
$assert(index >= 0, 'Illegal absIndex value');
index = index * sign;
@@ -82,14 +82,14 @@ mindplot.BidirectionalArray = new Class({
},
set : function(index, elem) {
$assert(index, 'Illegal index value');
$assert($defined(index), 'Illegal index value');
var array = (index >= 0) ? this._rightElem : this._leftElem;
array[Math.abs(index)] = elem;
},
length : function(index) {
$assert(index, 'Illegal index value');
$assert($defined(index), 'Illegal index value');
return (index >= 0) ? this._rightElem.length : this._leftElem.length;
},

View File

@@ -89,7 +89,7 @@ mindplot.MainTopicBoard = new Class({
addBranch : function(topic) {
var order = topic.getOrder();
$assert(order, "Order must be defined");
$assert($defined(order), "Order must be defined");
// If the entry is not available, I must swap the the entries...
var board = this._getBoard();

View File

@@ -41,7 +41,11 @@ mindplot.TextEditor = new Class({
});
inputContainer.inject(result);
var inputText = new Element('input', {type:"text",tabindex:'-1', value:""});
var inputText = new Element('input',
{type:"text",
tabindex:'-1',
value:""}
);
inputText.setStyles({
border:"none",
background:"transparent"
@@ -146,7 +150,7 @@ mindplot.TextEditor = new Class({
// Set editor's initial size
var displayFunc = function() {
// Position the editor and set the size...
var textShape = this._topic.getTextShape();
var textShape = this._topic.getTextShape();
textShape.positionRelativeTo(this._divElem, {
position: {x: 'left',y:'top'},
edge: {x: 'left', y: 'top'}
@@ -221,10 +225,6 @@ mindplot.TextEditor = new Class({
this._divElem.style.height = this._size.height + "px";
},
_setPosition : function (x, y) {
$(this._divElem).setStyles({top : y + "px", left: x + "px"});
},
_changeCursor : function(inputElem, selectText) {
// Select text if it's required ...
if (inputElem.createTextRange) //ie

View File

@@ -27,7 +27,7 @@ mindplot.util.Shape =
calculateRectConnectionPoint: function(rectCenterPoint, rectSize, isAtRight) {
$assert(rectCenterPoint, 'rectCenterPoint can not be null');
$assert(rectSize, 'rectSize can not be null');
$assert(isAtRight, 'isRight can not be null');
$assert($defined(isAtRight), 'isRight can not be null');
// Node is placed at the right ?
var result = new core.Point();