2 YUI 3.13.0 (build 508226d)
3 Copyright 2013 Yahoo! Inc. All rights reserved.
4 Licensed under the BSD License.
5 http://yuilibrary.com/license/
8 YUI.add('tree-labelable', function (Y, NAME) {
10 /*jshint expr:true, onevar:false */
13 Extension for `Tree` that adds baked-in support for node labels like you might
14 see in a treeview or menu.
17 @submodule tree-labelable
22 Extension for `Tree` that adds baked-in support for node labels like you might
23 see in a treeview or menu.
30 function Labelable() {}
32 Labelable.prototype = {
33 initializer: function () {
34 this.nodeExtensions = this.nodeExtensions.concat(Y.Tree.Node.Labelable);
38 Y.Tree.Labelable = Labelable;
41 @submodule tree-labelable
45 `Tree.Node` extension that adds baked in support for labels like you might see
46 in a treeview or menu.
48 **Security note:** The label is stored in raw, unescaped form. If you choose to
49 render the label as HTML, be sure to escape it first with `Y.Escape.html()`
50 unless you actually intend to render raw HTML contained in the label.
52 @class Tree.Node.Labelable
54 @param {Tree} tree `Tree` instance with which this node should be associated.
55 @param {Object} [config] Configuration hash.
56 @param {String} [config.label=''] Label for this node.
57 @extensionfor Tree.Node
60 function NodeLabelable(tree, config) {
61 this._serializable = this._serializable.concat('label');
63 if ('label' in config) {
64 this.label = config.label;
68 NodeLabelable.prototype = {
72 **Security note:** The label is stored in raw, unescaped form. If you choose
73 to render the label as HTML, be sure to escape it first with
74 `Y.Escape.html()` unless you actually intend to render raw HTML contained in
77 @property {String} label
83 Y.Tree.Node.Labelable = NodeLabelable;
86 }, '3.13.0', {"requires": ["tree"]});