Skip to content
Browse files

Add default, update docs.

  • Loading branch information...
1 parent 15d63ef commit ca267a564a7f944a771c6c302d805c1eb98b97bc @kevinpschaaf kevinpschaaf committed
Showing with 24 additions and 10 deletions.
  1. +24 −10 src/lib/template/array-selector.html
View
34 src/lib/template/array-selector.html
@@ -78,6 +78,17 @@
},
/**
+ * When `true`, multiple items may be selected at once (in this case,
+ * `selected` is an array of currently selected items). When `false`,
+ * only one item may be selected at a time.
+ */
+ multi: {
+ type: Boolean,
+ value: false,
+ observer: '_resetSelection'
+ },
+
+ /**
* When `multi` is true, this is an array that contains any selected.
* When `multi` is false, this is the currently selected item, or `null`
* if no item is selected.
@@ -94,16 +105,6 @@
toggle: {
type: Boolean,
value: false
- },
-
- /**
- * When `true`, multiple items may be selected at once (in this case,
- * `selected` is an array of currently selected items). When `false`,
- * only one item may be selected at a time.
- */
- multi: {
- type: Boolean,
- observer: '_resetSelection'
}
},
@@ -128,6 +129,13 @@
}
},
+ /**
+ * Returns whether the item is currently selected.
+ *
+ * @method isSelected
+ * @param {*} item Item from `items` array to test
+ * @return {boolean} Whether the item is selected
+ */
isSelected: function(item) {
if (this.multi) {
return this._selectedColl.getKey(item) !== undefined;
@@ -138,6 +146,9 @@
/**
* Deselects the given item if it is already selected.
+ *
+ * @method isSelected
+ * @param {*} item Item from `items` array to deselect
*/
deselect: function(item) {
if (this.multi) {
@@ -156,6 +167,9 @@
/**
* Selects the given item. When `toggle` is true, this will automatically
* deselect the item if already selected.
+ *
+ * @method isSelected
+ * @param {*} item Item from `items` array to select
*/
select: function(item) {
var icol = Polymer.Collection.get(this.items);

0 comments on commit ca267a5

Please sign in to comment.
Something went wrong with that request. Please try again.