Skip to content

Commit

Permalink
Add debug value in the _internal object in order to disable the debug…
Browse files Browse the repository at this point in the history
… logging. Closes #79

Disable the debug logging by default
Update README.md to add information about debug
  • Loading branch information
nyroDev committed Apr 16, 2011
1 parent 489ebf6 commit f9e23ba
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,16 @@ Here is a list of the filters officially provided:
* Embedly: Used to show a bunch of different element using [embedly API](http://embed.ly/) ([Examples](http://nyromodal.nyrodev.com/v2/embedly.php)) (depends on link)

##Animations


##Debug
In order to enable the debug mode, you should change the debug value of the internal object. You can do it like:
$.nmInternal({debug: true});

By default, the debug function show function name in the console. If you want do something else, you should overwrite the _debug function like:
$.nmInternal({
_debug: function(msg) {
if (this.debug && window.console && window.console.log)
window.console.log(msg);
}
});
3 changes: 2 additions & 1 deletion js/jquery.nyroModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ jQuery(function($, undefined) {
},
_internal = {
firstInit: true,
debug: false,
stack: [],
fullSize: {
w: 0,
Expand Down Expand Up @@ -564,7 +565,7 @@ jQuery(function($, undefined) {
},

_debug: function(msg) {
if (window.console && window.console.log)
if (this.debug && window.console && window.console.log)
window.console.log(msg);
},

Expand Down

0 comments on commit f9e23ba

Please sign in to comment.