mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-12 09:27:36 +00:00
Store event handler proxy for size change
Workaround for bug 63094. Change-Id: I91855802486cd25e7109cad7d656eb40f6a3580c
This commit is contained in:
parent
91c4fcbca4
commit
41bc451d87
|
@ -253,9 +253,12 @@
|
|||
// Register handler for switching between wikitext/html snippets
|
||||
this.embedSwitch.on( 'select', $.proxy( embed.handleTypeSwitch, embed ) );
|
||||
|
||||
// workaround for bug 63094
|
||||
this.proxiedHandleSizeSwitch = this.proxiedHandleSizeSwitch || $.proxy( this.handleSizeSwitch, this );
|
||||
|
||||
// Register handlers for switching between file sizes
|
||||
this.embedHtmlSizeSwitch.getMenu().on( 'select', $.proxy( embed.handleSizeSwitch, embed ) );
|
||||
this.embedWtSizeSwitch.getMenu().on( 'select', $.proxy( embed.handleSizeSwitch, embed ) );
|
||||
this.embedHtmlSizeSwitch.getMenu().on( 'select', this.proxiedHandleSizeSwitch );
|
||||
this.embedWtSizeSwitch.getMenu().on( 'select', this.proxiedHandleSizeSwitch );
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -267,8 +270,9 @@
|
|||
this.embedTextHtml.offDOMEvent( 'focus mousedown click' );
|
||||
this.embedTextWikitext.offDOMEvent( 'focus mousedown click' );
|
||||
this.embedSwitch.off( 'select' );
|
||||
this.embedHtmlSizeSwitch.getMenu().off( 'select' );
|
||||
this.embedWtSizeSwitch.getMenu().off( 'select' );
|
||||
// the noop is needed for some tests which call unattach before calling attach.
|
||||
this.embedHtmlSizeSwitch.getMenu().off( 'select', this.proxiedHandleSizeSwitch || $.noop );
|
||||
this.embedWtSizeSwitch.getMenu().off( 'select', this.proxiedHandleSizeSwitch || $.noop );
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue