Skip to content

Commit

Permalink
Prettify: Trigger the ready event when prettify has finished processing
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentGoderre committed Aug 11, 2014
1 parent 7e2ae90 commit 71bb869
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/plugins/prettify/prettify.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ var componentName = "wb-prettify",
}
},

prettifyDone = function() {

// Identify that initialization has completed
wb.ready( $document, componentName );
},

/*
* Invoke the Google pretty print library if it has been initialized
* @method prettyprint
Expand All @@ -115,10 +121,7 @@ var componentName = "wb-prettify",
if ( event.namespace === componentName &&
typeof window.prettyPrint === "function" ) {

window.prettyPrint();

// Identify that initialization has completed
wb.ready( $document, componentName );
window.prettyPrint( prettifyDone );
}
};

Expand Down

0 comments on commit 71bb869

Please sign in to comment.