|
10 __coverage__['build/tree-openable/tree-openable.js'] = {"path":"build/tree-openable/tree-openable.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":44}}},"2":{"name":"Openable","line":41,"loc":{"start":{"line":41,"column":0},"end":{"line":41,"column":20}}},"3":{"name":"(anonymous_3)","line":45,"loc":{"start":{"line":45,"column":17},"end":{"line":45,"column":29}}},"4":{"name":"(anonymous_4)","line":64,"loc":{"start":{"line":64,"column":15},"end":{"line":64,"column":40}}},"5":{"name":"(anonymous_5)","line":91,"loc":{"start":{"line":91,"column":14},"end":{"line":91,"column":39}}},"6":{"name":"(anonymous_6)","line":120,"loc":{"start":{"line":120,"column":20},"end":{"line":120,"column":45}}},"7":{"name":"(anonymous_7)","line":134,"loc":{"start":{"line":134,"column":17},"end":{"line":134,"column":30}}},"8":{"name":"(anonymous_8)","line":145,"loc":{"start":{"line":145,"column":16},"end":{"line":145,"column":29}}},"9":{"name":"NodeOpenable","line":165,"loc":{"start":{"line":165,"column":0},"end":{"line":165,"column":24}}},"10":{"name":"(anonymous_10)","line":181,"loc":{"start":{"line":181,"column":11},"end":{"line":181,"column":30}}},"11":{"name":"(anonymous_11)","line":194,"loc":{"start":{"line":194,"column":12},"end":{"line":194,"column":24}}},"12":{"name":"(anonymous_12)","line":211,"loc":{"start":{"line":211,"column":10},"end":{"line":211,"column":29}}},"13":{"name":"(anonymous_13)","line":230,"loc":{"start":{"line":230,"column":16},"end":{"line":230,"column":35}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":239,"column":37}},"2":{"start":{"line":29,"column":0},"end":{"line":29,"column":24}},"3":{"start":{"line":39,"column":0},"end":{"line":39,"column":22}},"4":{"start":{"line":41,"column":0},"end":{"line":41,"column":22}},"5":{"start":{"line":43,"column":0},"end":{"line":148,"column":2}},"6":{"start":{"line":46,"column":8},"end":{"line":46,"column":79}},"7":{"start":{"line":65,"column":8},"end":{"line":73,"column":9}},"8":{"start":{"line":66,"column":12},"end":{"line":72,"column":15}},"9":{"start":{"line":75,"column":8},"end":{"line":75,"column":20}},"10":{"start":{"line":92,"column":8},"end":{"line":100,"column":9}},"11":{"start":{"line":93,"column":12},"end":{"line":99,"column":15}},"12":{"start":{"line":102,"column":8},"end":{"line":102,"column":20}},"13":{"start":{"line":121,"column":8},"end":{"line":122,"column":41}},"14":{"start":{"line":135,"column":8},"end":{"line":135,"column":33}},"15":{"start":{"line":146,"column":8},"end":{"line":146,"column":33}},"16":{"start":{"line":150,"column":0},"end":{"line":150,"column":27}},"17":{"start":{"line":165,"column":0},"end":{"line":165,"column":26}},"18":{"start":{"line":167,"column":0},"end":{"line":234,"column":2}},"19":{"start":{"line":182,"column":8},"end":{"line":182,"column":43}},"20":{"start":{"line":183,"column":8},"end":{"line":183,"column":20}},"21":{"start":{"line":195,"column":8},"end":{"line":195,"column":50}},"22":{"start":{"line":212,"column":8},"end":{"line":212,"column":42}},"23":{"start":{"line":213,"column":8},"end":{"line":213,"column":20}},"24":{"start":{"line":231,"column":8},"end":{"line":231,"column":48}},"25":{"start":{"line":232,"column":8},"end":{"line":232,"column":20}},"26":{"start":{"line":236,"column":0},"end":{"line":236,"column":36}}},"branchMap":{"1":{"line":65,"type":"if","locations":[{"start":{"line":65,"column":8},"end":{"line":65,"column":8}},{"start":{"line":65,"column":8},"end":{"line":65,"column":8}}]},"2":{"line":65,"type":"binary-expr","locations":[{"start":{"line":65,"column":12},"end":{"line":65,"column":32}},{"start":{"line":65,"column":36},"end":{"line":65,"column":49}}]},"3":{"line":68,"type":"binary-expr","locations":[{"start":{"line":68,"column":22},"end":{"line":68,"column":29}},{"start":{"line":68,"column":33},"end":{"line":68,"column":44}}]},"4":{"line":71,"type":"binary-expr","locations":[{"start":{"line":71,"column":27},"end":{"line":71,"column":34}},{"start":{"line":71,"column":38},"end":{"line":71,"column":52}}]},"5":{"line":92,"type":"if","locations":[{"start":{"line":92,"column":8},"end":{"line":92,"column":8}},{"start":{"line":92,"column":8},"end":{"line":92,"column":8}}]},"6":{"line":92,"type":"binary-expr","locations":[{"start":{"line":92,"column":12},"end":{"line":92,"column":32}},{"start":{"line":92,"column":36},"end":{"line":92,"column":50}}]},"7":{"line":95,"type":"binary-expr","locations":[{"start":{"line":95,"column":22},"end":{"line":95,"column":29}},{"start":{"line":95,"column":33},"end":{"line":95,"column":44}}]},"8":{"line":98,"type":"binary-expr","locations":[{"start":{"line":98,"column":27},"end":{"line":98,"column":34}},{"start":{"line":98,"column":38},"end":{"line":98,"column":52}}]},"9":{"line":121,"type":"cond-expr","locations":[{"start":{"line":121,"column":31},"end":{"line":121,"column":60}},{"start":{"line":122,"column":12},"end":{"line":122,"column":40}}]},"10":{"line":195,"type":"binary-expr","locations":[{"start":{"line":195,"column":15},"end":{"line":195,"column":32}},{"start":{"line":195,"column":36},"end":{"line":195,"column":49}}]}},"code":["(function () { YUI.add('tree-openable', function (Y, NAME) {","","/*jshint expr:true, onevar:false */","","/**","Extension for `Tree` that adds the concept of open/closed state for nodes.","","@module tree","@submodule tree-openable","@main tree-openable","**/","","/**","Extension for `Tree` that adds the concept of open/closed state for nodes.","","@class Tree.Openable","@constructor","@extensionfor Tree","**/","","/**","Fired when a node is closed.","","@event close","@param {Tree.Node} node Node being closed.","@param {String} src Source of the event.","@preventable _defCloseFn","**/","var EVT_CLOSE = 'close';","","/**","Fired when a node is opened.","","@event open","@param {Tree.Node} node Node being opened.","@param {String} src Source of the event.","@preventable _defOpenFn","**/","var EVT_OPEN = 'open';","","function Openable() {}","","Openable.prototype = {"," // -- Lifecycle ------------------------------------------------------------"," initializer: function () {"," this.nodeExtensions = this.nodeExtensions.concat(Y.Tree.Node.Openable);"," },",""," // -- Public Methods -------------------------------------------------------",""," /**"," Closes the specified node if it isn't already closed.",""," @method closeNode"," @param {Object} [options] Options."," @param {Boolean} [options.silent=false] If `true`, the `close` event"," will be suppressed."," @param {String} [options.src] Source of the change, to be passed along"," to the event facade of the resulting event. This can be used to"," distinguish between changes triggered by a user and changes"," triggered programmatically, for example."," @chainable"," **/"," closeNode: function (node, options) {"," if (node.canHaveChildren && node.isOpen()) {"," this._fireTreeEvent(EVT_CLOSE, {"," node: node,"," src : options && options.src"," }, {"," defaultFn: this._defCloseFn,"," silent : options && options.silent"," });"," }",""," return this;"," },",""," /**"," Opens the specified node if it isn't already open.",""," @method openNode"," @param {Object} [options] Options."," @param {Boolean} [options.silent=false] If `true`, the `open` event"," will be suppressed."," @param {String} [options.src] Source of the change, to be passed along"," to the event facade of the resulting event. This can be used to"," distinguish between changes triggered by a user and changes"," triggered programmatically, for example."," @chainable"," **/"," openNode: function (node, options) {"," if (node.canHaveChildren && !node.isOpen()) {"," this._fireTreeEvent(EVT_OPEN, {"," node: node,"," src : options && options.src"," }, {"," defaultFn: this._defOpenFn,"," silent : options && options.silent"," });"," }",""," return this;"," },",""," /**"," Toggles the open/closed state of the specified node, closing it if it's"," currently open or opening it if it's currently closed.",""," @method toggleOpenNode"," @param {Tree.Node} node Node to toggle."," @param {Object} [options] Options."," @param {Boolean} [options.silent=false] If `true`, events will be"," suppressed."," @param {String} [options.src] Source of the change, to be passed along"," to the event facade of the resulting event. This can be used to"," distinguish between changes triggered by a user and changes"," triggered programmatically, for example."," @chainable"," **/"," toggleOpenNode: function (node, options) {"," return node.isOpen() ? this.closeNode(node, options) :"," this.openNode(node, options);"," },",""," // -- Default Event Handlers -----------------------------------------------",""," /**"," Default handler for the `close` event.",""," @method _defCloseFn"," @param {EventFacade} e"," @protected"," **/"," _defCloseFn: function (e) {"," delete e.node.state.open;"," },",""," /**"," Default handler for the `open` event.",""," @method _defOpenFn"," @param {EventFacade} e"," @protected"," **/"," _defOpenFn: function (e) {"," e.node.state.open = true;"," }","};","","Y.Tree.Openable = Openable;","/**","@module tree","@submodule tree-openable","**/","","/**","`Tree.Node` extension that adds methods useful for nodes in trees that use the","`Tree.Openable` extension.","","@class Tree.Node.Openable","@constructor","@extensionfor Tree.Node","**/","","function NodeOpenable() {}","","NodeOpenable.prototype = {"," /**"," Closes this node if it's currently open.",""," @method close"," @param {Object} [options] Options."," @param {Boolean} [options.silent=false] If `true`, the `close` event"," will be suppressed."," @param {String} [options.src] Source of the change, to be passed along"," to the event facade of the resulting event. This can be used to"," distinguish between changes triggered by a user and changes"," triggered programmatically, for example."," @chainable"," **/"," close: function (options) {"," this.tree.closeNode(this, options);"," return this;"," },",""," /**"," Returns `true` if this node is currently open.",""," Note: the root node of a tree is always considered to be open.",""," @method isOpen"," @return {Boolean} `true` if this node is currently open, `false` otherwise."," **/"," isOpen: function () {"," return !!this.state.open || this.isRoot();"," },",""," /**"," Opens this node if it's currently closed.",""," @method open"," @param {Object} [options] Options."," @param {Boolean} [options.silent=false] If `true`, the `open` event"," will be suppressed."," @param {String} [options.src] Source of the change, to be passed along"," to the event facade of the resulting event. This can be used to"," distinguish between changes triggered by a user and changes"," triggered programmatically, for example."," @chainable"," **/"," open: function (options) {"," this.tree.openNode(this, options);"," return this;"," },",""," /**"," Toggles the open/closed state of this node, closing it if it's currently"," open or opening it if it's currently closed.",""," @method toggleOpen"," @param {Object} [options] Options."," @param {Boolean} [options.silent=false] If `true`, events will be"," suppressed."," @param {String} [options.src] Source of the change, to be passed along"," to the event facade of the resulting event. This can be used to"," distinguish between changes triggered by a user and changes"," triggered programmatically, for example."," @chainable"," **/"," toggleOpen: function (options) {"," this.tree.toggleOpenNode(this, options);"," return this;"," }","};","","Y.Tree.Node.Openable = NodeOpenable;","","","}, '3.10.3', {\"requires\": [\"tree\"]});","","}());"]}; |