@@ -45,6 +45,7 @@ jQuery(function($, undefined) {
4545 anims : { } , // Sepcific animations functions
4646 loadFilter : undefined , // Name of the filter used for loading
4747
48+ enabled : true , // Indicates if it's enabled or not
4849 modal : false , // Indicates if it's a modal window or not
4950 closeOnEscape : true , // Indicates if the modal should close on Escape key
5051 closeOnClick : true , // Indicates if a click on the background should close the modal
@@ -131,6 +132,8 @@ jQuery(function($, undefined) {
131132 } ,
132133 // Open the modal
133134 open : function ( ) {
135+ if ( ! this . enabled )
136+ return false ;
134137 if ( this . _nmOpener )
135138 this . _nmOpener . _close ( ) ;
136139 this . getInternal ( ) . _pushStack ( this . opener ) ;
@@ -651,9 +654,11 @@ jQuery(function($, undefined) {
651654 nm . _callFilters ( 'initFilters' ) ;
652655 nm . _callFilters ( 'init' ) ;
653656 nm . opener
654- . off ( 'nyroModal.nyroModal nmClose.nyroModal nmResize.nyroModal' )
657+ . off ( 'nyroModal.nyroModal nmDisable.nyroModal nmEnable.nyroModal nmClose.nyroModal nmResize.nyroModal' )
655658 . on ( {
656659 'nyroModal.nyroModal' : function ( ) { nm . open ( ) ; return false ; } ,
660+ 'nmDisable.nyroModal' : function ( ) { nm . enabled = false ; return false ; } ,
661+ 'nmEnable.nyroModal' : function ( ) { nm . enabled = true ; return false ; } ,
657662 'nmClose.nyroModal' : function ( ) { nm . close ( ) ; return false ; } ,
658663 'nmResize.nyroModal' : function ( ) { nm . resize ( ) ; return false ; }
659664 } ) ;
0 commit comments