renderer: Pass event to behavior for processing

I6d9ff52b introduced a regression where if a logged out user clicks the
settings cog then an error is thrown.

For now, passing the event to the behavior for further processing is
required. However, it's clear that this makes the
ext.Popups.PreviewBehavior abstraction leaky.

Bug: T162324
Change-Id: I9dea04eb7435f9349e60d477f5701ec5dd655ebd
This commit is contained in:
jdlrobson 2017-04-05 16:56:12 -07:00 committed by Sam Smith
parent 785a238fce
commit f80acb978b
4 changed files with 6 additions and 1 deletions

Binary file not shown.

Binary file not shown.

View file

@ -2,6 +2,11 @@ var mw = window.mediaWiki,
$ = jQuery;
/**
* A collection of event handlers specific to how the user interacts with all
* previews. The event handlers are are agnostic to how/when they are bound
* //but not to what they are bound//, i.e. the showSettings event handler is
* written to be bound to either an `<a>` or `<button>` element.
*
* @typedef {Object} ext.popups.PreviewBehavior
* @property {String} settingsUrl
* @property {Function} showSettings

View file

@ -280,7 +280,7 @@ function bindBehavior( preview, behavior ) {
.click( function ( event ) {
event.stopPropagation();
behavior.showSettings();
behavior.showSettings( event );
} );
}