MDL-83989 file upload: Filemanager breaks if you drop file outside of it

This commit is contained in:
Katie Ransom 2024-12-11 16:51:16 +00:00
parent e6c92dc291
commit 0a6cb5f2fa

View file

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