IDEMPIERE-3426:improve tab behavior

drag&drop effect
This commit is contained in:
hieplq 2017-07-17 23:17:37 +07:00
parent 3741f466da
commit a864e8b58a
1 changed files with 22 additions and 1 deletions

View File

@ -17,6 +17,27 @@ Copyright (C) 2007 Ashley G Ramdass.
if (console) console.log(msg);
};
// default non th, tr, td use clone method to create ghost element
// this code implement same behavior for li to get drag-drop effect
// still have room for improve: https://www.zkoss.org/wiki/ZK_Client-side_Reference/Customization/Drag-and-Drop_Effects
var superghost = zk.DnD.ghost;
zk.DnD.ghost = function (drag, ofs, msg) {
if (msg == null && drag.node){
var dragNode = jq(drag.node)[0];
var dragWg = zk.Widget.$(dragNode);
var textNote = dragWg.$n('real') || dragWg.getCaveNode();
if (jq.nodeName(dragNode, 'li')){
msg = textNote ? textNote.textContent || textNote.innerText || '' : '';
}
}
return superghost(drag, ofs, msg);
};
zk.$package('id.zk');
id.zk.Extend = zk.$extends(zk.Object, {}, {