Deskana has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/172945

Change subject: Do not change page title when loading image in MediaViewer.
......................................................................

Do not change page title when loading image in MediaViewer.

See bug 73347 for rationale. This patch also inadvertently fixes bug 69891.

Bug: 69891
Bug: 73347
Change-Id: Ie47b3f34613151465894f6966c52b2a293e1c3dc
---
M resources/mmv/mmv.js
1 file changed, 2 insertions(+), 21 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultimediaViewer 
refs/changes/45/172945/1

diff --git a/resources/mmv/mmv.js b/resources/mmv/mmv.js
index 46d440c..c76bbf5 100644
--- a/resources/mmv/mmv.js
+++ b/resources/mmv/mmv.js
@@ -787,10 +787,8 @@
         * Handles close event coming from the lightbox
         */
        MMVP.close = function () {
-               var windowTitle = this.createDocumentTitle( null );
-
                if ( comingFromHashChange === false ) {
-                       $( document ).trigger( $.Event( 'mmv-hash', { hash : 
'#', title: windowTitle } ) );
+                       $( document ).trigger( $.Event( 'mmv-hash', { hash : 
'#', title: this.documentTitle } ) );
                } else {
                        comingFromHashChange = false;
                }
@@ -808,13 +806,11 @@
                var route = this.router.parseLocation( window.location );
 
                if ( route instanceof mw.mmv.routing.ThumbnailRoute ) {
-                       document.title = this.createDocumentTitle( 
route.fileTitle );
                        this.loadImageByTitle( route.fileTitle );
                } else if ( this.isOpen ) {
                        // This allows us to avoid the mmv-hash event that 
normally happens on close
                        comingFromHashChange = true;
 
-                       document.title = this.createDocumentTitle( null );
                        if ( this.ui ) {
                                // FIXME triggers mmv-close event, which calls 
viewer.close()
                                this.ui.unattach();
@@ -829,22 +825,7 @@
                if ( !this.comingFromHashChange ) {
                        route = new mw.mmv.routing.ThumbnailRoute( 
this.currentImageFileTitle );
                        hashFragment = '#' + this.router.createHash( route );
-                       windowTitle = this.createDocumentTitle( 
this.currentImageFileTitle );
-                       $( document ).trigger( $.Event( 'mmv-hash', { hash : 
hashFragment, title: windowTitle } ) );
-               }
-       };
-
-       /**
-        * Creates a string which can be shown as document title (the text at 
the top of the browser window).
-        * @param {mw.Title|null} imageTitle the title object for the image 
which is displayed; null when the
-        *  viewer is being closed
-        * @return {string}
-        */
-       MMVP.createDocumentTitle = function ( imageTitle ) {
-               if ( imageTitle ) {
-                       return imageTitle.getNameText() + ' - ' + 
this.documentTitle;
-               } else {
-                       return this.documentTitle;
+                       $( document ).trigger( $.Event( 'mmv-hash', { hash : 
hashFragment, title: this.documentTitle } ) );
                }
        };
 

-- 
To view, visit https://gerrit.wikimedia.org/r/172945
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie47b3f34613151465894f6966c52b2a293e1c3dc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MultimediaViewer
Gerrit-Branch: master
Gerrit-Owner: Deskana <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to