mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-23 23:24:39 +00:00
renderer: Bind behavior when preview is shown
Binding the behavior to the preview before it's shown means that the application will respond to user interactions with the preview even though it's transparent. This fixes scenario 4 from T159490. Bug: T159490 Change-Id: Ia2d06869868d07af60bdeb49d46612a4a0dc02e9
This commit is contained in:
parent
ae9733b2f0
commit
82648226ef
BIN
resources/dist/index.js
vendored
BIN
resources/dist/index.js
vendored
Binary file not shown.
BIN
resources/dist/index.js.map
vendored
BIN
resources/dist/index.js.map
vendored
Binary file not shown.
|
@ -267,6 +267,22 @@ function show( preview, event, behavior ) {
|
|||
|
||||
layoutPreview( preview, layout );
|
||||
|
||||
preview.el.show();
|
||||
|
||||
return wait( 200 )
|
||||
.then( function () {
|
||||
bindBehavior( preview, behavior );
|
||||
} )
|
||||
.then( behavior.previewShow );
|
||||
}
|
||||
|
||||
/**
|
||||
* Binds the behavior to the interactive elements of the preview.
|
||||
*
|
||||
* @param {ext.popups.Preview} preview
|
||||
* @param {ext.popups.PreviewBehavior} behavior
|
||||
*/
|
||||
function bindBehavior( preview, behavior ) {
|
||||
preview.el.hover( behavior.previewDwell, behavior.previewAbandon );
|
||||
|
||||
preview.el.click( behavior.click );
|
||||
|
@ -278,11 +294,6 @@ function show( preview, event, behavior ) {
|
|||
|
||||
behavior.showSettings();
|
||||
} );
|
||||
|
||||
preview.el.show();
|
||||
|
||||
return wait( 200 )
|
||||
.then( behavior.previewShow );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue