Permalink
Browse files

Adding domReady to prototype

  • Loading branch information...
markstory committed Mar 28, 2009
1 parent 8cc5990 commit 55eafaf112b422419482ccd3210390f575183837
@@ -88,7 +88,8 @@ function event($type, $callback, $options = array()) {
* @return string completed domReady method
**/
function domReady($functionBody) {
-
+ $this->selection = 'document';
+ return $this->event('dom:loaded', $functionBody, array('stop' => false));
}
/**
* Create an iteration over the current selection result.
@@ -94,7 +94,9 @@ function testEvent() {
* @return void
**/
function testDomReady() {
-
+ $result = $this->Proto->domReady('foo.name = "bar";');
+ $expected = 'document.observe("dom:loaded", function (event) {foo.name = "bar";});';
+ $this->assertEqual($result, $expected);
}
/**
* test Each method

0 comments on commit 55eafaf

Please sign in to comment.