From 3d1dc9bfc6c4e1d358fa4270116ac912ac7ddb2a Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 26 Sep 2012 20:00:38 -0300 Subject: [PATCH] - Fix Cannot call method 'getTextShape' of null' --- mindplot/src/main/javascript/MultilineTextEditor.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mindplot/src/main/javascript/MultilineTextEditor.js b/mindplot/src/main/javascript/MultilineTextEditor.js index ce68ad31..b1b730c9 100644 --- a/mindplot/src/main/javascript/MultilineTextEditor.js +++ b/mindplot/src/main/javascript/MultilineTextEditor.js @@ -20,6 +20,7 @@ mindplot.MultilineTextEditor = new Class({ Extends:Events, initialize:function () { this._topic = null; + this._timeoutId = -1; }, _buildEditor:function () { @@ -203,7 +204,7 @@ mindplot.MultilineTextEditor = new Class({ }.bind(this); - displayFunc.delay(10); + this._timeoutId = displayFunc.delay(10); }, _setStyle:function (fontStyle) { @@ -273,6 +274,8 @@ mindplot.MultilineTextEditor = new Class({ close:function (update) { if (this.isVisible()) { // Update changes ... + clearTimeout(this._timeoutId); + if (!$defined(update) || update) { this._updateModel(); } @@ -284,6 +287,7 @@ mindplot.MultilineTextEditor = new Class({ this._containerElem.dispose(); this._containerElem = null; this._topic = null; + this._timeoutId = -1; } } });