]> git.wh0rd.org - tt-rss.git/blobdiff - lib/dijit/tree/ObjectStoreModel.js
lib: Upgrade Dojo and Dijit from 1.8.3 to 1.12.1
[tt-rss.git] / lib / dijit / tree / ObjectStoreModel.js
index 7021bec527f3db4ff8a6144c1a9039c64386d7bf..6592d74ff28e743949a93da44bc019a6557ce975 100644 (file)
@@ -1,2 +1,2 @@
 //>>built
-define("dijit/tree/ObjectStoreModel",["dojo/_base/array","dojo/aspect","dojo/_base/declare","dojo/_base/lang","dojo/when"],function(_1,_2,_3,_4,_5){return _3("dijit.tree.ObjectStoreModel",null,{store:null,labelAttr:"name",root:null,query:null,constructor:function(_6){_4.mixin(this,_6);this.childrenCache={};},destroy:function(){for(var id in this.childrenCache){this.childrenCache[id].close&&this.childrenCache[id].close();}},getRoot:function(_7,_8){if(this.root){_7(this.root);}else{var _9;_5(_9=this.store.query(this.query),_4.hitch(this,function(_a){if(_a.length!=1){throw new Error("dijit.tree.ObjectStoreModel: root query returned "+_a.length+" items, but must return exactly one");}this.root=_a[0];_7(this.root);if(_9.observe){_9.observe(_4.hitch(this,function(_b){this.onChange(_b);}),true);}}),_8);}},mayHaveChildren:function(){return true;},getChildren:function(_c,_d,_e){var id=this.store.getIdentity(_c);if(this.childrenCache[id]){_5(this.childrenCache[id],_d,_e);return;}var _f=this.childrenCache[id]=this.store.getChildren(_c);_5(_f,_d,_e);if(_f.observe){_f.observe(_4.hitch(this,function(obj,_10,_11){this.onChange(obj);if(_10!=_11){_5(_f,_4.hitch(this,"onChildrenChange",_c));}}),true);}},isItem:function(){return true;},fetchItemByIdentity:function(_12){this.store.get(_12.identity).then(_4.hitch(_12.scope,_12.onItem),_4.hitch(_12.scope,_12.onError));},getIdentity:function(_13){return this.store.getIdentity(_13);},getLabel:function(_14){return _14[this.labelAttr];},newItem:function(_15,_16,_17,_18){return this.store.put(_15,{parent:_16,before:_18});},pasteItem:function(_19,_1a,_1b,_1c,_1d,_1e){if(!_1c){var _1f=[].concat(this.childrenCache[this.getIdentity(_1a)]),_20=_1.indexOf(_1f,_19);_1f.splice(_20,1);this.onChildrenChange(_1a,_1f);}return this.store.put(_19,{overwrite:true,parent:_1b,before:_1e});},onChange:function(){},onChildrenChange:function(){},onDelete:function(){}});});
\ No newline at end of file
+define("dijit/tree/ObjectStoreModel",["dojo/_base/array","dojo/aspect","dojo/_base/declare","dojo/Deferred","dojo/_base/lang","dojo/when","../Destroyable"],function(_1,_2,_3,_4,_5,_6,_7){return _3("dijit.tree.ObjectStoreModel",_7,{store:null,labelAttr:"name",labelType:"text",root:null,query:null,constructor:function(_8){_5.mixin(this,_8);this.childrenCache={};},getRoot:function(_9,_a){if(this.root){_9(this.root);}else{var _b=this.store.query(this.query);if(_b.then){this.own(_b);}_6(_b,_5.hitch(this,function(_c){if(_c.length!=1){throw new Error("dijit.tree.ObjectStoreModel: root query returned "+_c.length+" items, but must return exactly one");}this.root=_c[0];_9(this.root);if(_b.observe){_b.observe(_5.hitch(this,function(_d){this.onChange(_d);}),true);}}),_a);}},mayHaveChildren:function(){return true;},getChildren:function(_e,_f,_10){var id=this.store.getIdentity(_e);if(this.childrenCache[id]){_6(this.childrenCache[id],_f,_10);return;}var res=this.childrenCache[id]=this.store.getChildren(_e);if(res.then){this.own(res);}if(res.observe){this.own(res.observe(_5.hitch(this,function(obj,_11,_12){this.onChange(obj);if(_11!=_12){_6(res,_5.hitch(this,"onChildrenChange",_e));}}),true));}_6(res,_f,_10);},isItem:function(){return true;},getIdentity:function(_13){return this.store.getIdentity(_13);},getLabel:function(_14){return _14[this.labelAttr];},newItem:function(_15,_16,_17,_18){return this.store.put(_15,{parent:_16,before:_18});},pasteItem:function(_19,_1a,_1b,_1c,_1d,_1e){var d=new _4();if(_1a===_1b&&!_1c&&!_1e){d.resolve(true);return d;}if(_1a&&!_1c){this.getChildren(_1a,_5.hitch(this,function(_1f){_1f=[].concat(_1f);var _20=_1.indexOf(_1f,_19);_1f.splice(_20,1);this.onChildrenChange(_1a,_1f);d.resolve(this.store.put(_19,{overwrite:true,parent:_1b,oldParent:_1a,before:_1e}));}));}else{d.resolve(this.store.put(_19,{overwrite:true,parent:_1b,oldParent:_1a,before:_1e}));}return d;},onChange:function(){},onChildrenChange:function(){},onDelete:function(){}});});
\ No newline at end of file