Skip to content
This repository was archived by the owner on Mar 13, 2018. It is now read-only.

Commit 8c2bc5b

Browse files
committed
Merge pull request #29 from carlosbaraza/master
Remove some trailing spaces
2 parents f718f66 + 822b725 commit 8c2bc5b

File tree

4 files changed

+44
-44
lines changed

4 files changed

+44
-44
lines changed

core-selector.html

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130

131131
/**
132132
* Specifies the CSS class to be used to add to the selected element.
133-
*
133+
*
134134
* @attribute selectedClass
135135
* @type string
136136
* @default 'core-selected'
@@ -162,7 +162,7 @@
162162
* an array of selected elements.
163163
* Note that you should not use this to set the selection. Instead use
164164
* `selected`.
165-
*
165+
*
166166
* @attribute selectedItem
167167
* @type Object
168168
* @default null
@@ -172,9 +172,9 @@
172172
/**
173173
* In single selection, this returns the model associated with the
174174
* selected element.
175-
* Note that you should not use this to set the selection. Instead use
175+
* Note that you should not use this to set the selection. Instead use
176176
* `selected`.
177-
*
177+
*
178178
* @attribute selectedModel
179179
* @type Object
180180
* @default null
@@ -193,7 +193,7 @@
193193
selectedIndex: -1,
194194

195195
/**
196-
* Nodes with local name that are in the list will not be included
196+
* Nodes with local name that are in the list will not be included
197197
* in the selection items. In the following example, `items` returns four
198198
* `core-item`'s and doesn't include `h3` and `hr`.
199199
*
@@ -213,17 +213,17 @@
213213
excludedLocalNames: '',
214214

215215
/**
216-
* The target element that contains items. If this is not set
216+
* The target element that contains items. If this is not set
217217
* core-selector is the container.
218-
*
218+
*
219219
* @attribute target
220220
* @type Object
221221
* @default null
222222
*/
223223
target: null,
224224

225225
/**
226-
* This can be used to query nodes from the target node to be used for
226+
* This can be used to query nodes from the target node to be used for
227227
* selection items. Note this only works if `target` is set
228228
* and is not `core-selector` itself.
229229
*
@@ -236,7 +236,7 @@
236236
* <label><input type="radio" name="color" value="blue"> Blue</label> <br>
237237
* <p>color = {{color}}</p>
238238
* </form>
239-
*
239+
*
240240
* @attribute itemsSelector
241241
* @type string
242242
* @default ''
@@ -264,7 +264,7 @@
264264
notap: false,
265265

266266
defaultExcludedLocalNames: 'template',
267-
267+
268268
observe: {
269269
'selected multi': 'selectedChanged'
270270
},
@@ -288,8 +288,8 @@
288288
if (!this.target) {
289289
return [];
290290
}
291-
var nodes = this.target !== this ? (this.itemsSelector ?
292-
this.target.querySelectorAll(this.itemsSelector) :
291+
var nodes = this.target !== this ? (this.itemsSelector ?
292+
this.target.querySelectorAll(this.itemsSelector) :
293293
this.target.children) : this.$.items.getDistributedNodes();
294294
return Array.prototype.filter.call(nodes, this.itemFilter);
295295
},
@@ -332,7 +332,7 @@
332332

333333
/**
334334
* Returns the selected item(s). If the `multi` property is true,
335-
* this will return an array, otherwise it will return
335+
* this will return an array, otherwise it will return
336336
* the selected item or undefined if there is no selection.
337337
*/
338338
get selection() {
@@ -348,7 +348,7 @@
348348
this.updateSelected();
349349
}
350350
},
351-
351+
352352
updateSelected: function() {
353353
this.validateSelected();
354354
if (this.multi) {
@@ -363,7 +363,7 @@
363363

364364
validateSelected: function() {
365365
// convert to an array for multi-selection
366-
if (this.multi && !Array.isArray(this.selected) &&
366+
if (this.multi && !Array.isArray(this.selected) &&
367367
this.selected != null) {
368368
this.selected = [this.selected];
369369
// use the first selected in the array for single-selection
@@ -373,7 +373,7 @@
373373
this.selected = s;
374374
}
375375
},
376-
376+
377377
processSplices: function(splices) {
378378
for (var i = 0, splice; splice = splices[i]; i++) {
379379
for (var j = 0; j < splice.removed.length; j++) {
@@ -398,7 +398,7 @@
398398
var item = this.valueToItem(value);
399399
this.$.selection.select(item);
400400
},
401-
401+
402402
setValueSelected: function(value, isSelected) {
403403
var item = this.valueToItem(value);
404404
if (isSelected ^ this.$.selection.isSelected(item)) {
@@ -417,12 +417,12 @@
417417
} else {
418418
this.selectedModel = null;
419419
}
420-
this.selectedIndex = this.selectedItem ?
420+
this.selectedIndex = this.selectedItem ?
421421
parseInt(this.valueToIndex(this.selected)) : -1;
422422
},
423-
423+
424424
valueToItem: function(value) {
425-
return (value === null || value === undefined) ?
425+
return (value === null || value === undefined) ?
426426
null : this.items[this.valueToIndex(value)];
427427
},
428428

@@ -506,15 +506,15 @@
506506
target = target.parentNode;
507507
}
508508
},
509-
509+
510510
selectIndex: function(index) {
511511
var item = this.items[index];
512512
if (item) {
513513
this.selected = this.valueForNode(item) || index;
514514
return item;
515515
}
516516
},
517-
517+
518518
/**
519519
* Selects the previous item. This should be used in single selection only.
520520
*
@@ -524,11 +524,11 @@
524524
* @returns the previous item or undefined if there is none
525525
*/
526526
selectPrevious: function(wrapped) {
527-
var i = wrapped && !this.selectedIndex ?
527+
var i = wrapped && !this.selectedIndex ?
528528
this.items.length - 1 : this.selectedIndex - 1;
529529
return this.selectIndex(i);
530530
},
531-
531+
532532
/**
533533
* Selects the next item. This should be used in single selection only.
534534
*
@@ -538,11 +538,11 @@
538538
* @returns the next item or undefined if there is none
539539
*/
540540
selectNext: function(wrapped) {
541-
var i = wrapped && this.selectedIndex >= this.items.length - 1 ?
541+
var i = wrapped && this.selectedIndex >= this.items.length - 1 ?
542542
0 : this.selectedIndex + 1;
543543
return this.selectIndex(i);
544544
}
545-
545+
546546
});
547547
</script>
548548
</polymer-element>

demo.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,29 +27,29 @@
2727
margin: 0;
2828
padding: 0;
2929
}
30-
30+
3131
.list > * {
3232
height: 40px;
3333
line-height: 40px;
3434
padding: 0 20px;
3535
border-bottom: 1px solid #ccc;
3636
}
37-
37+
3838
.list > *.core-selected {
3939
background: #333;
4040
}
41-
41+
4242
li {
4343
height: 30px;
4444
}
45-
45+
4646
li.core-selected:after {
4747
content: "\2713";
4848
position: absolute;
4949
padding-left: 10px;
5050
}
5151
</style>
52-
52+
5353
<h2>basic</h2>
5454
<core-selector class="list" selected="0">
5555
<div>Item 0</div>
@@ -58,7 +58,7 @@ <h2>basic</h2>
5858
<div>Item 3</div>
5959
<div>Item 4</div>
6060
</core-selector>
61-
61+
6262
<h2>multi-selection</h2>
6363
<core-selector class="list" selected="{{multiSelected}}" multi>
6464
<div>Item 0</div>
@@ -67,7 +67,7 @@ <h2>multi-selection</h2>
6767
<div>Item 3</div>
6868
<div>Item 4</div>
6969
</core-selector>
70-
70+
7171
<h2>list</h2>
7272
<core-selector target="{{$.list}}" selected="0"></core-selector>
7373
<ul id="list">
@@ -77,18 +77,18 @@ <h2>list</h2>
7777
<li>Item 3</li>
7878
<li>Item 4</li>
7979
</ul>
80-
80+
8181
<h2>binding of a group of radio buttons to a variable</h2>
82-
<core-selector target="{{$.myForm}}" itemsSelector="input[type=radio]"
83-
selected="{{color}}" valueattr="value" selectedProperty="checked"
82+
<core-selector target="{{$.myForm}}" itemsSelector="input[type=radio]"
83+
selected="{{color}}" valueattr="value" selectedProperty="checked"
8484
activateEvent="change"></core-selector>
8585
<form id="myForm">
8686
<label><input type="radio" name="color" value="red"> Red</label> <br>
8787
<label><input type="radio" name="color" value="green"> Green</label> <br>
8888
<label><input type="radio" name="color" value="blue"> Blue</label> <br>
8989
<p>color = {{color}}</p>
9090
</form>
91-
91+
9292
</template>
9393

9494
<script>
@@ -100,7 +100,7 @@ <h2>binding of a group of radio buttons to a variable</h2>
100100
});
101101
</script>
102102
</polymer-element>
103-
103+
104104
<selector-examples></selector-examples>
105105
</body>
106106
</html>

test/content.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@
4343
</test-core-selector>
4444

4545
<script>
46-
46+
4747
var s = document.querySelector('test-core-selector');
4848

4949
suite('content', function() {
50-
50+
5151
test('get selected', function(done) {
5252
asyncPlatformFlush(function() {
5353
// check selected class
@@ -65,11 +65,11 @@
6565
done();
6666
});
6767
});
68-
68+
6969
test('get items', function() {
7070
assert.equal(s.$.selector.items.length, s.children.length);
7171
});
72-
72+
7373
test('activate event', function(done) {
7474
s.children[2].dispatchEvent(new CustomEvent('tap', {bubbles: true}));
7575
asyncPlatformFlush(function() {
@@ -78,7 +78,7 @@
7878
done();
7979
});
8080
});
81-
81+
8282
test('add item dynamically', function(done) {
8383
var item = document.createElement('div');
8484
item.id = 'item4';

test/multi.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
});
9292
});
9393
});
94-
94+
9595
test('toggle multi to false', function(done) {
9696
// set selected
9797
s.selected = [0, 2];

0 commit comments

Comments
 (0)