Skip to content

Commit

Permalink
fix rm
Browse files Browse the repository at this point in the history
  • Loading branch information
Katochimoto committed Jul 19, 2015
1 parent f2603d9 commit 889c349
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ckeditor-imgresize",
"version": "1.0.4",
"version": "1.0.5",
"main": [
"plugin.js"
],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ckeditor-imgresize",
"version": "1.0.4",
"version": "1.0.5",
"description": "CKEditor dragable image resizing with support divarea",
"keywords": [
"ckeditor",
Expand Down
13 changes: 4 additions & 9 deletions plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,25 +199,20 @@
return;
}

var isRestoreFocus = (event && event.restoreFocus);

for (var eventName in this._editorHideEvents) {
this._editor.removeListener(eventName, this._hideWrapper);
}

this._wrapper.removeAllListeners();

if (isRestoreFocus) {
var selection = this._editor.getSelection();
selection.removeAllRanges();
var selection = this._editor.getSelection();
selection.removeAllRanges();

this._element.replace(this._wrapper);
this._element.replace(this._wrapper);

if (event && event.restoreFocus) {
selection.selectElement(this._element);
this._element.focus();

} else {
this._element.replace(this._wrapper);
}

delete this._wrapper;
Expand Down

0 comments on commit 889c349

Please sign in to comment.