Clear interface before opening again

Bug: 56055
Change-Id: I1a36617ea7b141e0d695ff44ef3b05a2e327b4c4
This commit is contained in:
Mark Holmquist 2013-10-23 16:51:34 -07:00 committed by MarkTraceur
parent 4dd724838d
commit ab2949e95f
4 changed files with 17 additions and 0 deletions

View file

@ -238,6 +238,11 @@
this.$imageMetadata.show();
}
} );
lightboxHooks.register( 'clearInterface', function () {
this.$imageDesc.empty();
this.$title.empty();
} );
}
MultimediaViewer.prototype.fetchRepoInfo = function ( cb ) {

View file

@ -72,3 +72,8 @@ defullscreen
Arguments: None
ThisArg: LightboxInterface
Called: From LightboxInterface fullscreen method when user is leaving fullscreen interface.
clearInterface
Arguments: None
ThisArg: LightboxInterface
Called: From LightboxInterface empty method when the interface is being cleared.

View file

@ -76,6 +76,12 @@
LIP = LightboxInterface.prototype;
LIP.empty = function () {
this.$imageDiv.empty();
lightboxHooks.callAll( 'clearInterface', this );
};
LIP.attach = function () {
$( document.body )
.append(

View file

@ -77,6 +77,7 @@
};
MLBP.open = function () {
this.iface.empty();
this.iface.attach();
this.iface.load( this.images[this.currentIndex] );
};