From 2148e0d5ccafe6eea1234b17d5eac99913ff2685 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 17 Nov 2010 23:32:32 +0300 Subject: [PATCH] experimental work on draggable pref feed tree --- PrefFeedTree.js | 16 ++++++++++++++++ modules/pref-feeds.php | 11 ++--------- prefs.js | 2 ++ 3 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 PrefFeedTree.js diff --git a/PrefFeedTree.js b/PrefFeedTree.js new file mode 100644 index 00000000..f8d1e7b1 --- /dev/null +++ b/PrefFeedTree.js @@ -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; + }, +}); + diff --git a/modules/pref-feeds.php b/modules/pref-feeds.php index f5afbb3e..10b7462e 100644 --- a/modules/pref-feeds.php +++ b/modules/pref-feeds.php @@ -1046,15 +1046,14 @@ query=\"{id:'root'}\" rootId=\"root\" rootLabel=\"Feeds\" childrenAttrs=\"items\" checkboxStrict=\"false\" checkboxAll=\"false\"> -
- -
"; /* diff --git a/prefs.js b/prefs.js index e4e002c1..42f51087 100644 --- 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); -- 2.39.5