Index: trunk/parsers/wikidom/lib/es/es.Container.js |
— | — | @@ -7,6 +7,7 @@ |
8 | 8 | * @param typeName {String} |
9 | 9 | * @param listName {String} |
10 | 10 | * @param items {Array} List of items |
| 11 | + * @emits "update" when items argument causes items to be appended |
11 | 12 | * @property _typeName {String} |
12 | 13 | * @property _listName {String} |
13 | 14 | * @property _list {Array} |
— | — | @@ -32,11 +33,12 @@ |
33 | 34 | this.append( items[i] ); |
34 | 35 | } |
35 | 36 | } |
36 | | -} |
| 37 | +}; |
37 | 38 | |
38 | 39 | /** |
39 | 40 | * Gets the first item in the container. |
40 | 41 | * |
| 42 | + * @method |
41 | 43 | * @returns {Object} |
42 | 44 | */ |
43 | 45 | es.Container.prototype.first = function() { |
— | — | @@ -46,6 +48,7 @@ |
47 | 49 | /** |
48 | 50 | * Gets the last item in the container. |
49 | 51 | * |
| 52 | + * @method |
50 | 53 | * @returns {Object} |
51 | 54 | */ |
52 | 55 | es.Container.prototype.last = function() { |
— | — | @@ -56,7 +59,11 @@ |
57 | 60 | /** |
58 | 61 | * Adds an item to the end of the container. |
59 | 62 | * |
| 63 | + * Also inserts item's Element object to the DOM and adds a listener to its "update" events. |
| 64 | + * |
| 65 | + * @method |
60 | 66 | * @param {Object} Item to append |
| 67 | + * @emits "update" |
61 | 68 | */ |
62 | 69 | es.Container.prototype.append = function( item ) { |
63 | 70 | item[this._typeName] = this; |
— | — | @@ -72,7 +79,11 @@ |
73 | 80 | /** |
74 | 81 | * Adds an item to the beginning of the container. |
75 | 82 | * |
| 83 | + * Also inserts item's Element object to the DOM and adds a listener to its "update" events. |
| 84 | + * |
| 85 | + * @method |
76 | 86 | * @param {Object} Item to prepend |
| 87 | + * @emits "update" |
77 | 88 | */ |
78 | 89 | es.Container.prototype.prepend = function( item ) { |
79 | 90 | item[this._typeName] = this; |
— | — | @@ -88,8 +99,12 @@ |
89 | 100 | /** |
90 | 101 | * Adds an item to the container after an existing item. |
91 | 102 | * |
| 103 | + * Also inserts item's Element object to the DOM and adds a listener to its "update" events. |
| 104 | + * |
| 105 | + * @method |
92 | 106 | * @param item {Object} Item to insert |
93 | 107 | * @param before {Object} Item to insert before, if null then item will be inserted at the end |
| 108 | + * @emits "update" |
94 | 109 | */ |
95 | 110 | es.Container.prototype.insertBefore = function( item, before ) { |
96 | 111 | item[this._typeName] = this; |
— | — | @@ -108,8 +123,13 @@ |
109 | 124 | }; |
110 | 125 | /** |
111 | 126 | * Adds an item to the container after an existing item. |
| 127 | + * |
| 128 | + * Also inserts item's Element object to the DOM and adds a listener to its "update" events. |
| 129 | + * |
| 130 | + * @method |
112 | 131 | * @param item {Object} Item to insert |
113 | 132 | * @param after {Object} Item to insert after, if null then item will be inserted at the end |
| 133 | + * @emits "update" |
114 | 134 | */ |
115 | 135 | es.Container.prototype.insertAfter = function( item, after ) { |
116 | 136 | item[this._typeName] = this; |
— | — | @@ -130,7 +150,11 @@ |
131 | 151 | /** |
132 | 152 | * Removes an item from the container. |
133 | 153 | * |
| 154 | + * Also detaches item's Element object to the DOM and removes all listeners its "update" events. |
| 155 | + * |
| 156 | + * @method |
134 | 157 | * @param {Object} Item to remove |
| 158 | + * @emits "update" |
135 | 159 | */ |
136 | 160 | es.Container.prototype.remove = function( item ) { |
137 | 161 | item.removeAllListeners( 'update' ); |