Sumit has uploaded a new change for review.

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

Change subject: MobileFrontend fix back on Special:Nearby
......................................................................

MobileFrontend fix back on Special:Nearby

Fixes back on browser from an article reached via
Special:Nearby/#page/Page_Title

Bug: T117412
Change-Id: I1b9574b24d2a12fe942da7ecbe5d7a62b8508bbf
---
M resources/mobile.nearby/Nearby.js
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/76/258476/1

diff --git a/resources/mobile.nearby/Nearby.js 
b/resources/mobile.nearby/Nearby.js
index 11f3156..438f605 100644
--- a/resources/mobile.nearby/Nearby.js
+++ b/resources/mobile.nearby/Nearby.js
@@ -229,7 +229,10 @@
                                // FIXME: not unique if multiple Nearby objects 
on same page
                                $( this ).attr( 'id', 'nearby-page-list-item-' 
+ i );
                        } ).on( 'click', function () {
-                               window.location.hash = $( this ).attr( 'id' );
+                               // if not on Special:Nearby/#page/page_title, 
then set hash to clicked element
+                               if ( hash.indexOf( '#' ) === -1 ) {
+                                       window.location.hash = hash + '#' + $( 
this ).attr( 'id' );
+                               }
                        } );
 
                        // Restore the offset

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1b9574b24d2a12fe942da7ecbe5d7a62b8508bbf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Sumit <[email protected]>

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

Reply via email to