Skip to content

Commit f9e23ba

Browse files
committed
Add debug value in the _internal object in order to disable the debug logging. Closes #79
Disable the debug logging by default Update README.md to add information about debug
1 parent 489ebf6 commit f9e23ba

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,3 +249,16 @@ Here is a list of the filters officially provided:
249249
* 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)
250250

251251
##Animations
252+
253+
254+
##Debug
255+
In order to enable the debug mode, you should change the debug value of the internal object. You can do it like:
256+
$.nmInternal({debug: true});
257+
258+
By default, the debug function show function name in the console. If you want do something else, you should overwrite the _debug function like:
259+
$.nmInternal({
260+
_debug: function(msg) {
261+
if (this.debug && window.console && window.console.log)
262+
window.console.log(msg);
263+
}
264+
});

js/jquery.nyroModal.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,7 @@ jQuery(function($, undefined) {
502502
},
503503
_internal = {
504504
firstInit: true,
505+
debug: false,
505506
stack: [],
506507
fullSize: {
507508
w: 0,
@@ -564,7 +565,7 @@ jQuery(function($, undefined) {
564565
},
565566

566567
_debug: function(msg) {
567-
if (window.console && window.console.log)
568+
if (this.debug && window.console && window.console.log)
568569
window.console.log(msg);
569570
},
570571

0 commit comments

Comments
 (0)