]>
Commit | Line | Data |
---|---|---|
2148e0d5 AD |
1 | dojo.provide("fox.PrefFeedTree"); |
2 | ||
3 | dojo.require("lib.CheckBoxTree"); | |
4 | ||
5 | dojo.declare("fox.PrefFeedTree", lib.CheckBoxTree, { | |
6 | checkItemAcceptance: function(target, source, position) { | |
7 | var item = dijit.getEnclosingWidget(target).item; | |
8 | ||
49c6c279 AD |
9 | // disable copying items |
10 | source.copyState = function() { return false; } | |
11 | ||
12 | var source_item = false; | |
13 | ||
14 | source.forInSelectedItems(function(node) { | |
15 | source_item = node.data.item; | |
16 | }); | |
17 | ||
18 | if (!source_item || !item) return false; | |
19 | ||
2148e0d5 | 20 | var id = String(item.id); |
49c6c279 AD |
21 | var source_id = String(source_item.id); |
22 | ||
23 | var id = this.tree.model.store.getValue(item, 'id'); | |
24 | var source_id = source.tree.model.store.getValue(source_item, 'id'); | |
25 | ||
26 | //console.log(id + " " + position + " " + source_id); | |
27 | ||
28 | if (source_id.match("FEED:")) { | |
29 | return ((id.match("CAT:") && position == "over") || | |
30 | (id.match("FEED:") && position != "over")); | |
31 | } else if (source_id.match("CAT:")) { | |
32 | return ((id.match("CAT:") && position != "over") || | |
33 | (id.match("root") && position == "over")); | |
34 | } | |
2148e0d5 AD |
35 | }, |
36 | }); | |
37 |