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:
Sam Smith 2017-03-22 10:45:37 +00:00 committed by jdlrobson
parent ae9733b2f0
commit 82648226ef
3 changed files with 16 additions and 5 deletions

Binary file not shown.

Binary file not shown.

View file

@ -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 );
}
/**