Skip to content
Permalink
Browse files

Adding each() to prototype engine

  • Loading branch information...
markstory committed Mar 28, 2009
1 parent 55eafaf commit 768941baebe32a137b2484e71a99a7e57bf1986f
@@ -99,7 +99,7 @@ function domReady($functionBody) {
* @return string completed iteration
**/
function each($callback) {
return $this->selection . '.each(function (item, index) {' . $callback . '});';
}
/**
* Trigger an Effect.
@@ -104,7 +104,9 @@ function testDomReady() {
* @return void
**/
function testEach() {
$result = $this->Proto->get('#foo li')->each('item.hide();');
$expected = '$$("#foo li").each(function (item, index) {item.hide();});';
$this->assertEqual($result, $expected);
}
/**
* test Effect generation

0 comments on commit 768941b

Please sign in to comment.
You can’t perform that action at this time.