From f937b1f20d4e6941ce522c95d27e3dc6c33d098a Mon Sep 17 00:00:00 2001 From: mhutti1 Date: Thu, 7 Jan 2016 21:01:49 +0100 Subject: [PATCH] Fixed viewer only displaying every nth image after reopening Added code to detach emit calls when the interface is closed. Bug: T122785 Change-Id: Ifd97aebe7aa01a152817100f301a80a9b6ac83a3 --- resources/mmv/mmv.lightboxinterface.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resources/mmv/mmv.lightboxinterface.js b/resources/mmv/mmv.lightboxinterface.js index 18b0474be..d866d1eee 100644 --- a/resources/mmv/mmv.lightboxinterface.js +++ b/resources/mmv/mmv.lightboxinterface.js @@ -276,6 +276,11 @@ this.clearEvents(); + this.buttons.disconnect( this, { + 'next': [ 'emit', 'next' ], + 'prev': [ 'emit', 'prev' ] + } ); + // We trigger this event on the document because unattach() can run // when the interface is unattached $( document ).trigger( $.Event( 'mmv-close' ) )