This commit is contained in:
Sara Arjona 2021-11-11 12:44:25 +01:00
commit d650e65265
5 changed files with 13 additions and 30 deletions

View File

@ -280,16 +280,15 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
*
* @method _handleDragDrop
* @param {EventFacade} e
* @return {boolean} false if we handled the event, else true.
* @private
*/
_handleDragDrop: function(e) {
if (!e._event || !e._event.dataTransfer) {
// Drop not fully supported in this browser.
return true;
return;
}
return this._handlePasteOrDropHelper(e, e._event.dataTransfer);
this._handlePasteOrDropHelper(e, e._event.dataTransfer);
},
/**
@ -335,13 +334,7 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
}
if (didUpload) {
// We handled this.
e.preventDefault();
e.stopPropagation();
return false;
} else {
// Let someone else try to handle it.
return true;
}
},

File diff suppressed because one or more lines are too long

View File

@ -280,16 +280,15 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
*
* @method _handleDragDrop
* @param {EventFacade} e
* @return {boolean} false if we handled the event, else true.
* @private
*/
_handleDragDrop: function(e) {
if (!e._event || !e._event.dataTransfer) {
// Drop not fully supported in this browser.
return true;
return;
}
return this._handlePasteOrDropHelper(e, e._event.dataTransfer);
this._handlePasteOrDropHelper(e, e._event.dataTransfer);
},
/**
@ -335,13 +334,7 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
}
if (didUpload) {
// We handled this.
e.preventDefault();
e.stopPropagation();
return false;
} else {
// Let someone else try to handle it.
return true;
}
},

View File

@ -278,16 +278,15 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
*
* @method _handleDragDrop
* @param {EventFacade} e
* @return {boolean} false if we handled the event, else true.
* @private
*/
_handleDragDrop: function(e) {
if (!e._event || !e._event.dataTransfer) {
// Drop not fully supported in this browser.
return true;
return;
}
return this._handlePasteOrDropHelper(e, e._event.dataTransfer);
this._handlePasteOrDropHelper(e, e._event.dataTransfer);
},
/**
@ -333,13 +332,7 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
}
if (didUpload) {
// We handled this.
e.preventDefault();
e.stopPropagation();
return false;
} else {
// Let someone else try to handle it.
return true;
}
},

View File

@ -174,6 +174,10 @@ M.form_dndupload.init = function(Y, options) {
init_page_events: function() {
this.Y.on('dragenter', this.drag_enter_page, 'body', this);
this.Y.on('dragleave', this.drag_leave_page, 'body', this);
this.Y.on('drop', function() {
this.pageentercount = 0;
this.hide_drop_target();
}.bind(this));
},
/**