From dca82c38666c98c25bcf0e7a4d5910bc66a8eca6 Mon Sep 17 00:00:00 2001 From: Gilles Dubuc Date: Fri, 12 Sep 2014 10:48:04 +0200 Subject: [PATCH] Fix over reported use-this-file-close event Merely opening media viewer would trigger it. Change-Id: I62f4685b821aace3d6323c511d5ad889c1745c4b Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/889 --- resources/mmv/ui/mmv.ui.reuse.dialog.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/mmv/ui/mmv.ui.reuse.dialog.js b/resources/mmv/ui/mmv.ui.reuse.dialog.js index 3e5b6fb03..820a0d08e 100644 --- a/resources/mmv/ui/mmv.ui.reuse.dialog.js +++ b/resources/mmv/ui/mmv.ui.reuse.dialog.js @@ -285,7 +285,9 @@ * Closes the reuse dialog. */ DP.closeDialog = function () { - mw.mmv.actionLogger.log( 'use-this-file-close' ); + if ( this.isOpen ) { + mw.mmv.actionLogger.log( 'use-this-file-close' ); + } this.stopListeningToOutsideClick(); this.$reuseDialog.hide();