From bd5e71ba6a84b4cda484bb4e4a8a77889bb0a02d Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 4 Jan 2011 22:20:24 -0800 Subject: More drag/drop tweaks. - Fix a bug in the prior commit where we could no longer drag/drop in the thumb_data_view. - Change the CSS class when dropping items in the tree panel to be a check box, not a plus symbol. --- modules/organize/views/organize_dialog.html.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'modules') diff --git a/modules/organize/views/organize_dialog.html.php b/modules/organize/views/organize_dialog.html.php index 4d4bf990..b398a19d 100644 --- a/modules/organize/views/organize_dialog.html.php +++ b/modules/organize/views/organize_dialog.html.php @@ -128,6 +128,7 @@ }); v.dropZone = new Ext.dd.DropZone(v.getEl(), { + ddGroup: "organizeDD", getTargetFromEvent: function(e) { return e.getTarget("div.thumb", 10); }, @@ -293,6 +294,22 @@ load_album_data(node.id); }, "afterrender": function(v) { + // Override Ext.tree.TreeDragZone.onNodeOver to change the + // x-tree-drop-ok-append CSS class to be x-dd-drop-ok since + // that connotes "ok" instead of "adding something new" and we're + // moving the item, not adding it. + // + // There's probably a better way of overriding the parent method, but + // my JavaScript-fu is weak. + v.dropZone.super_onNodeOver = v.dropZone.onNodeOver; + v.dropZone.onNodeOver = function(target, dd, e, data) { + var returnCls = this.super_onNodeOver(target, dd, e, data); + if (returnCls == "x-tree-drop-ok-append") { + return "x-dd-drop-ok"; + } + return returnCls; + } + v.dropZone.onNodeDrop = function(target, dd, e, data) { var nodes = data.nodes; source_ids = []; -- cgit v1.2.3