]> git.wh0rd.org Git - tt-rss.git/commitdiff
experimental work on draggable pref feed tree
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 17 Nov 2010 20:32:32 +0000 (23:32 +0300)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 17 Nov 2010 20:32:32 +0000 (23:32 +0300)
PrefFeedTree.js [new file with mode: 0644]
modules/pref-feeds.php
prefs.js

diff --git a/PrefFeedTree.js b/PrefFeedTree.js
new file mode 100644 (file)
index 0000000..f8d1e7b
--- /dev/null
@@ -0,0 +1,16 @@
+dojo.provide("fox.PrefFeedTree");
+
+dojo.require("lib.CheckBoxTree");
+
+dojo.declare("fox.PrefFeedTree", lib.CheckBoxTree, {
+       checkItemAcceptance: function(target, source, position) {
+               var item = dijit.getEnclosingWidget(target).item;
+
+               console.log(source.currentWidget);
+               
+               var id = String(item.id);
+               return (id.match("CAT:") || position != "over");
+               return true;
+       },
+});
+
index f5afbb3e102db3fd86424f91dc9df0d0bf80f879..10b7462ece7afd86213b7b939a384aefab5e62ee 100644 (file)
                query=\"{id:'root'}\" rootId=\"root\" rootLabel=\"Feeds\"
                        childrenAttrs=\"items\" checkboxStrict=\"false\" checkboxAll=\"false\">
                </div>
-               <div dojoType=\"lib.CheckBoxTree\" id=\"feedTree\" _dndController=\"dijit.tree.dndSource\" 
+               <div dojoType=\"fox.PrefFeedTree\" id=\"feedTree\" 
+                       dndController=\"dijit.tree.dndSource\" 
                        betweenThreshold=\"1\"
                        model=\"feedModel\" openOnClick=\"false\">
                <script type=\"dojo/method\" event=\"onClick\" args=\"item\">
                        var id = String(item.id);
                        var bare_id = id.substr(id.indexOf(':')+1);
 
-                       console.log('onClick: ' + id);
-
                        if (id.match('FEED')) {
                                editFeed(bare_id, event);
                        }
                <script type=\"dojo/method\" event=\"onLoad\" args=\"item\">
                        Element.hide(\"feedlistLoading\");
                </script>
-               <script type=\"dojo/method\" event=\"checkItemAcceptance\" args=\"item, source, position\">
-                       var source_item = dijit.getEnclosingWidget(source);
-                       console.log(item);
-                       console.log(source_item);
-               </script>
-
                </div>";
 
                /*
index e4e002c13483a4f46237e8f23fcfd0beccab2721..42f51087d7767647ffd2c2a590a591f68d008b77 100644 (file)
--- a/prefs.js
+++ b/prefs.js
@@ -1175,8 +1175,10 @@ function init() {
                dojo.require("dijit.tree.dndSource");
 
                dojo.registerModulePath("lib", "..");
+               dojo.registerModulePath("fox", "../..");
 
                dojo.require("lib.CheckBoxTree");
+               dojo.require("fox.PrefFeedTree");
 
                loading_set_progress(30);