| OLD | NEW |
| 1 | 1 |
| 2 <!-- | 2 <!-- |
| 3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | 3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
| 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
| 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
| 7 Code distributed by Google as part of the polymer project is also | 7 Code distributed by Google as part of the polymer project is also |
| 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt | 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
| 9 --> | 9 --> |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 /** | 26 /** |
| 27 * Retrieves the selected item(s). | 27 * Retrieves the selected item(s). |
| 28 * | 28 * |
| 29 * @method get | 29 * @method get |
| 30 * @returns Returns the selected item(s). If the multi property is true, | 30 * @returns Returns the selected item(s). If the multi property is true, |
| 31 * `get` will return an array, otherwise it will return | 31 * `get` will return an array, otherwise it will return |
| 32 * the selected item or undefined if there is no selection. | 32 * the selected item or undefined if there is no selection. |
| 33 */ | 33 */ |
| 34 get: function() { | 34 get: function() { |
| 35 return this.multi ? this.selection : this.selection[0]; | 35 return this.multi ? this.selection.slice() : this.selection[0]; |
| 36 }, | 36 }, |
| 37 | 37 |
| 38 /** | 38 /** |
| 39 * Clears all the selection except the ones indicated. | 39 * Clears all the selection except the ones indicated. |
| 40 * | 40 * |
| 41 * @method clear | 41 * @method clear |
| 42 * @param {Array} excludes items to be excluded. | 42 * @param {Array} excludes items to be excluded. |
| 43 */ | 43 */ |
| 44 clear: function(excludes) { | 44 clear: function(excludes) { |
| 45 this.selection.slice().forEach(function(item) { | 45 this.selection.slice().forEach(function(item) { |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 * @method toggle | 106 * @method toggle |
| 107 * @param {*} item The item to toggle. | 107 * @param {*} item The item to toggle. |
| 108 */ | 108 */ |
| 109 toggle: function(item) { | 109 toggle: function(item) { |
| 110 this.setItemSelected(item, !this.isSelected(item)); | 110 this.setItemSelected(item, !this.isSelected(item)); |
| 111 } | 111 } |
| 112 | 112 |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 </script> | 115 </script> |
| OLD | NEW |