Skip to content

Commit

Permalink
ExtJS 6.2 DnD fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
brusch committed Nov 24, 2016
1 parent ca76f97 commit 84cc004
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions pimcore/static6/js/pimcore/document/edit/dnd.js
Expand Up @@ -24,6 +24,7 @@ pimcore.document.edit.dnd = Class.create({
this.dndManager = parentExt.dd.DragDropMgr;
var iFrameElement = parent.Ext.get('document_iframe_' + window.editWindow.document.id);

iFrameElement.dom.setAttribute("dragdropmanager-preventdefault", "true");
body.addListener('mousemove', this.ddMouseMove.bind(this));
body.addListener('mouseup', this.ddMouseUp.bind(this));

Expand Down
10 changes: 7 additions & 3 deletions pimcore/static6/js/pimcore/overrides.js
Expand Up @@ -21,13 +21,17 @@ Ext.override(Ext.dd.DragDropManager, {
},

handleMouseMove: function (e) {
this.callParent(arguments);

var preventDefault = true;
if(e.target && e.target.getAttribute("dragdropmanager-preventdefault")) {
preventDefault = false;
}

// stops text selection while dragging an element
if(this.dragCurrent) {
if(this.dragCurrent && preventDefault) {
e.preventDefault();
}

this.callParent(arguments);
},

handleMouseUp: function(e) {
Expand Down

0 comments on commit 84cc004

Please sign in to comment.