Skip to content

Commit

Permalink
upeate
Browse files Browse the repository at this point in the history
  • Loading branch information
RubyLouvre committed Apr 21, 2013
1 parent 33364dd commit e6b58cd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
5 changes: 3 additions & 2 deletions doc/avalon/class-binding.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@ <h3>class-binding</h3>
<button class="doc_btn" type="button">点我,执行代码</button>
<fieldset>
<legend>例子</legend>
<div ms-class="{ 'my-class':true, 'your-class':true, 'his-class':true }">多个类名</div>
<div ms-class-toggle="{{toggle}}">这个类名会改变</div>
<div ms-class="{ 'my-class':true, 'your-class':true, 'his-class':true }">多个类名</div>
<div ms-class-blink="timestamp % 2">这个不断在闪</div>
<div ms-class-toggle="toggle">这个类名会改变</div>
</fieldset>
</article>
</body>
Expand Down
7 changes: 6 additions & 1 deletion doc/avalon/each-binding.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ <h3>each-binding</h3>
<button class="doc_btn" type="button">点我,执行代码</button>
<fieldset>
<legend>例子</legend>
<div ms-class="{ 'my-class':true, 'your-class':true, 'his-class':true }">xxxxxxxxx</div>
<ul ms-each-el="array1">
<li>{{$index}}---{{el}}</li>
</ul>
<ul ms-each-elem="array2">
<li>现在排行第{{$index+1}}的语言是{{elem.name}}</li>
</ul>
</fieldset>
</article>
</body>
Expand Down
5 changes: 4 additions & 1 deletion node.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ define("node", ["support", "class", "data"]
}));
},
each: function(fn) {
return $.each(this, fn);
for(var i = 0, n = this.length; i < n; i++){
fn.call(this[i], i, this[i]);
}
return this;
},
map: function(fn) {
return this.labor($.map(this, fn));
Expand Down

0 comments on commit e6b58cd

Please sign in to comment.