Skip to content

Commit

Permalink
драг картинки с враппером в сафари
Browse files Browse the repository at this point in the history
  • Loading branch information
Katochimoto committed Aug 19, 2015
1 parent 7a61df8 commit 187b034
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
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.11",
"version": "1.0.12",
"description": "CKEditor dragable image resizing with support divarea",
"keywords": [
"ckeditor",
Expand Down
17 changes: 13 additions & 4 deletions plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
return;
}

this._imgresize.show(new CKEDITOR.dom.element(nativeEvent.target));
this._imgresize.toggle(new CKEDITOR.dom.element(nativeEvent.target));
}
});

Expand All @@ -138,12 +138,21 @@
'beforeCommandExec': { 'restoreFocus': true },
'beforeSetMode': null,
'destroy': null,
'dragstart': null,
'dragstart': { 'restoreFocus': true },
'paste': null,
'readOnly': null
};

Resizer.prototype.show = function(element) {
Resizer.prototype.toggle = function(element) {
if (this._wrapper) {
this._hideWrapper({ 'listenerData': { 'restoreFocus': true } });

} else {
this._showWrapper(element);
}
};

Resizer.prototype._showWrapper = function(element) {
this._element = element;
this._wrapper = this._getWrapper(this._element);

Expand All @@ -162,8 +171,8 @@
this._controls = this._wrapper.findOne('.cke_imgresize_controls');
this._preview = this._wrapper.findOne('.cke_imgresize_preview');

this._wrapper.on('drag:start', this._onDragStart, this);
this._wrapper.on('drag:drag', this._onDragDrag, this);
this._wrapper.on('drag:start', this._onDragStart, this);
this._wrapper.on('drag:stop', this._onDragStop, this);
this._wrapper.on('mousedown', this._initDrag, this, null, 0);
this._wrapper.once('blur', this._hideWrapper, this, { 'restoreFocus': true }, 0);
Expand Down

0 comments on commit 187b034

Please sign in to comment.