This repository was archived by the owner on Sep 11, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 8989 function Images ( el , options ) {
9090 this . el = el ;
9191 this . $el = $ ( el ) ;
92+ this . $currentImage = null ;
9293 this . templates = window . MediumInsert . Templates ;
9394 this . core = this . $el . data ( 'plugin_' + pluginName ) ;
9495
427428 var $image = $ ( e . target ) ,
428429 that = this ;
429430
431+ this . $currentImage = $image ;
432+
430433 // Hide keyboard on mobile devices
431434 this . $el . blur ( ) ;
432435
469472 } else if ( $el . is ( 'figcaption' ) === false ) {
470473 this . core . removeCaptions ( ) ;
471474 }
475+ this . $currentImage = null ;
472476 } ;
473477
474478 /**
595599 */
596600
597601 Images . prototype . toolbarAction = function ( e ) {
602+ if ( this . $currentImage === null ) return ;
598603 var $button = $ ( e . target ) . is ( 'button' ) ? $ ( e . target ) : $ ( e . target ) . closest ( 'button' ) ,
599604 $li = $button . closest ( 'li' ) ,
600605 $ul = $li . closest ( 'ul' ) ,
636641 */
637642
638643 Images . prototype . toolbar2Action = function ( e ) {
644+ if ( this . $currentImage === null ) return ;
639645 var $button = $ ( e . target ) . is ( 'button' ) ? $ ( e . target ) : $ ( e . target ) . closest ( 'button' ) ,
640646 callback = this . options . actions [ $button . data ( 'action' ) ] . clicked ;
641647
You can’t perform that action at this time.
0 commit comments