This repository was archived by the owner on Jun 11, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed
Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -389,8 +389,7 @@ Thumbs.View = (function () {
389389 this . events = this . events || { } ;
390390
391391 this . $ ( '[data-thumbs-delegate]' ) . each ( function ( ) {
392- hasEvents = true ;
393- self . _bindEvents ( this ) ;
392+ hasEvents = self . _bindEvents ( this ) || hasEvents ;
394393 } ) ;
395394 if ( hasEvents ) {
396395 this . delegateEvents ( ) ;
@@ -400,8 +399,10 @@ Thumbs.View = (function () {
400399
401400 _bindEvents : function ( element ) {
402401 var self = this ,
402+ bound = false ,
403403 thumbsView = viewRegistry . get ( $ ( element ) . attr ( "thumbs-id" ) ) ;
404404 if ( viewRegistry . getEnclosingView ( element ) === self ) {
405+ bound = true ;
405406 var $element = $ ( element ) , id = _ . uniqueId ( 'thumbs_' ) ;
406407 $element . addClass ( id ) ;
407408 splitParts ( $element . data ( 'thumbs-delegate' ) , function ( data ) {
@@ -413,6 +414,7 @@ Thumbs.View = (function () {
413414 }
414415 } ) ;
415416 }
417+ return bound ;
416418 } ,
417419
418420 render : function ( ) {
Original file line number Diff line number Diff line change 682682 this . events = this . events || { } ;
683683
684684 this . $ ( '[data-thumbs-delegate]' ) . each ( function ( ) {
685- hasEvents = true ;
686- self . _bindEvents ( this ) ;
685+ hasEvents = self . _bindEvents ( this ) || hasEvents ;
687686 } ) ;
688687 if ( hasEvents ) {
689688 this . delegateEvents ( ) ;
693692
694693 _bindEvents : function ( element ) {
695694 var self = this ,
695+ bound = false ,
696696 thumbsView = viewRegistry . get ( $ ( element ) . attr ( "thumbs-id" ) ) ;
697697 if ( viewRegistry . getEnclosingView ( element ) === self ) {
698+ bound = true ;
698699 var $element = $ ( element ) , id = _ . uniqueId ( 'thumbs_' ) ;
699700 $element . addClass ( id ) ;
700701 splitParts ( $element . data ( 'thumbs-delegate' ) , function ( data ) {
706707 }
707708 } ) ;
708709 }
710+ return bound ;
709711 } ,
710712
711713 render : function ( ) {
You can’t perform that action at this time.
0 commit comments