experimental work on draggable pref feed tree

This commit is contained in:
Andrew Dolgov 2010-11-17 23:32:32 +03:00
parent 05f224a3d7
commit 2148e0d5cc
3 changed files with 20 additions and 9 deletions

16
PrefFeedTree.js Normal file
View File

@ -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;
},
});

View File

@ -1046,15 +1046,14 @@
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);
}
@ -1063,12 +1062,6 @@
<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>";
/*

View File

@ -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);