Skip to content

Commit

Permalink
Merge pull request #289 from hyukmin-kwon/master
Browse files Browse the repository at this point in the history
[TASK] #162 Editor resizing related refactoring - (bug fix)
  • Loading branch information
hwshim committed Jul 24, 2015
2 parents ce6b7df + d845339 commit 157c082
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -954,9 +954,13 @@ define([
delete this.deferredActions;
}

topic.subscribe('editor-panel-resize-finished', function () {
this.resizeTopicHandler = topic.subscribe('editor-panel-resize-finished', function () {
self.__checkSizeChange();
});

this.closeTopicHandler = topic.subscribe('editors.closed', function (path) {
self.refresh();
});

this.editor.on('mousedown', function (cm, e) {
if (settings.gotoLinkEnabled) {
Expand Down
16 changes: 14 additions & 2 deletions apps/ide/src/plugins/webida.editor.text-editor/TextEditorViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,13 @@ define([
delete this.deferredActions;
}

topic.subscribe('editor-panel-resize-finished', function () {
this.resizeTopicHandler = topic.subscribe('editor-panel-resize-finished', function () {
self.__checkSizeChange();
});

this.closeTopicHandler = topic.subscribe('editors.closed', function (path) {
self.refresh();
});

// conditionally indent on paste
self.editor.on('change', function(cm, e) {
Expand Down Expand Up @@ -338,7 +342,15 @@ define([
},

destroy: function() {
$(this.elem).html('');
//unsubscribing topics

this.resizeTopicHandler.remove();
this.resizeTopicHandler = null;

this.closeTopicHandler.remove();
this.closeTopicHandler = null;

$(this.elem).html('');
},

addChangeListener: function(listener) {
Expand Down

0 comments on commit 157c082

Please sign in to comment.