Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Commit

Permalink
camel-cased the ejs.bodyReady method for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
scottjehl committed Apr 18, 2012
1 parent 913b870 commit 9c21087
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -60,9 +60,9 @@ All of the Enhance api is available via `window.ejs` or just `ejs`. From `ejs`,
});
In a pinch, `onDefine` could also be used to delay code execution until another JS file has loaded and executed.

- `bodyready`: run a callback function when the body element is defined. Accepts one argument: a callback function to execute when the `body` element becomes defined. This is merely a shortcut to the `onDefine` example above. Example:
- `bodyReady`: run a callback function when the body element is defined. Accepts one argument: a callback function to execute when the `body` element becomes defined. This is merely a shortcut to the `onDefine` example above. Example:

ejs.bodyready( function(){
ejs.bodyReady( function(){
if( ejs.hasClass( document.body, "home" ) ){
// the body element has a class of "home"...
}
Expand Down
2 changes: 1 addition & 1 deletion _demo/enhance.audit.js
Expand Up @@ -56,7 +56,7 @@
// (beware: don't rely on loading CSS this way for styles that need to ejsly at page load or you'll get a FOUC)

// Note: since we're using hasClass to check if the body element has a class or not, we need to wrap all remaining logic in a call to ejs.isDefined
ejs.bodyready( function(){
ejs.bodyReady( function(){

if( ejs.hasClass( win.document.body, "tmpl-home" ) ){
ejs.addFile( ejs.files.css.sample );
Expand Down
2 changes: 1 addition & 1 deletion enhance.js
Expand Up @@ -42,7 +42,7 @@
};

// shortcut of isDefine body-specific
ejs.bodyready = function( callback ){
ejs.bodyReady = function( callback ){
ejs.onDefine( "document.body", callback );
};

Expand Down

0 comments on commit 9c21087

Please sign in to comment.