]>
git.wh0rd.org - tt-rss.git/blob - PrefFeedTree.js
1 dojo
.provide("fox.PrefFeedTree");
3 dojo
.require("lib.CheckBoxTree");
5 dojo
.declare("fox.PrefFeedTree", lib
.CheckBoxTree
, {
6 checkItemAcceptance: function(target
, source
, position
) {
7 var item
= dijit
.getEnclosingWidget(target
).item
;
9 // disable copying items
10 source
.copyState = function() { return false; }
12 var source_item
= false;
14 source
.forInSelectedItems(function(node
) {
15 source_item
= node
.data
.item
;
18 if (!source_item
|| !item
) return false;
20 var id
= String(item
.id
);
21 var source_id
= String(source_item
.id
);
23 var id
= this.tree
.model
.store
.getValue(item
, 'id');
24 var source_id
= source
.tree
.model
.store
.getValue(source_item
, 'id');
26 //console.log(id + " " + position + " " + source_id);
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"));