Skip to content

Commit

Permalink
supporting option for slim-repeat
Browse files Browse the repository at this point in the history
  • Loading branch information
eavichay committed Apr 2, 2017
1 parent fc06298 commit 0fddfe5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Slim.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ class Slim extends HTMLElement {
type: 'R',
target: child,
targetAttribute: child.getAttribute('slim-repeat-as') ? child.getAttribute('slim-repeat-as') : 'data',
repeatAdjacent: child.hasAttribute('slim-repeat-adjacent'),
repeatAdjacent: child.hasAttribute('slim-repeat-adjacent') || child.localName === 'option',
attribute: attribute.nodeName,
properties: [ attribute.nodeValue ],
source: child._boundParent
Expand Down
1 change: 0 additions & 1 deletion bin/Slim.min.js

This file was deleted.

4 changes: 4 additions & 0 deletions example/tests/test-repeater.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<script>
Slim.tag('repeat-tester',
`
<select>
<option slim-repeat="items" value="[[data.value]]" bind>[[data.label]]</option>
</select>
<ul>
<li slim-repeat="items" slim-repeat-as="item" click="handleItemSelect">
<span active="[[isActive(item)]]" bind>[[item.label]]</span>
Expand All @@ -16,6 +19,7 @@
`,
class extends Slim {
onBeforeCreated() {
window.unit = this;
this.items = [
{label: 'item 1', value: 1},
{label: 'item 2', value: 2},
Expand Down

0 comments on commit 0fddfe5

Please sign in to comment.