diff options
author | Bharat Mediratta <bharat@menalto.com> | 2011-01-04 22:20:24 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2011-01-04 22:20:24 -0800 |
commit | bd5e71ba6a84b4cda484bb4e4a8a77889bb0a02d (patch) | |
tree | b35696b10031ffc2f8c6a9c2a8e4780d49777153 /modules/organize/views | |
parent | 31652eae44bdd93b45d965a8288a3069e37d1934 (diff) |
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.
Diffstat (limited to 'modules/organize/views')
-rw-r--r-- | modules/organize/views/organize_dialog.html.php | 17 |
1 files changed, 17 insertions, 0 deletions
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 = []; |