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 9090 function Images ( el , options ) {
9191 this . el = el ;
9292 this . $el = $ ( el ) ;
93+ this . $currentImage = null ;
9394 this . templates = window . MediumInsert . Templates ;
9495 this . core = this . $el . data ( 'plugin_' + pluginName ) ;
9596
428429 var $image = $ ( e . target ) ,
429430 that = this ;
430431
432+ this . $currentImage = $image ;
433+
431434 // Hide keyboard on mobile devices
432435 this . $el . blur ( ) ;
433436
470473 } else if ( $el . is ( 'figcaption' ) === false ) {
471474 this . core . removeCaptions ( ) ;
472475 }
476+ this . $currentImage = null ;
473477 } ;
474478
475479 /**
596600 */
597601
598602 Images . prototype . toolbarAction = function ( e ) {
603+ if ( this . $currentImage === null ) return ;
599604 var $button = $ ( e . target ) . is ( 'button' ) ? $ ( e . target ) : $ ( e . target ) . closest ( 'button' ) ,
600605 $li = $button . closest ( 'li' ) ,
601606 $ul = $li . closest ( 'ul' ) ,
637642 */
638643
639644 Images . prototype . toolbar2Action = function ( e ) {
645+ if ( this . $currentImage === null ) return ;
640646 var $button = $ ( e . target ) . is ( 'button' ) ? $ ( e . target ) : $ ( e . target ) . closest ( 'button' ) ,
641647 callback = this . options . actions [ $button . data ( 'action' ) ] . clicked ;
642648
You can’t perform that action at this time.
0 commit comments