r114152 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114151‎ | r114152 | r114153 >
Date:16:40, 19 March 2012
Author:jdlrobson
Status:ok
Tags:
Comment:
track last link

if I click [1] to open reference [1] and then click
[2] to open up reference [2] this shouldn't create
a toggle
follow up to r114134
Modified paths:
  • /trunk/extensions/MobileFrontend/javascripts/references.js (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/javascripts/references.js
@@ -33,7 +33,7 @@
3434 $( '<div id="mf-references"><div></div></div>' ).hide().appendTo( document.body );
3535 var close = function() {
3636 $( '#mf-references' ).fadeOut( options.animationSpeed );
37 - };
 37+ }, lastLink;
3838 $( '<button>close</button>' ).click( close ).appendTo( '#mf-references' );
3939 $( '.mw-cite-backlink a' ).click( close );
4040
@@ -43,7 +43,8 @@
4444 data = href && href.charAt(0) === '#' ?
4545 references[ href.substr( 1, href.length ) ] : null;
4646
47 - if( !$("#mf-references").is(":visible") ) {
 47+ if( !$("#mf-references").is(":visible") || lastLink !== href) {
 48+ lastLink = href;
4849 if( data ) {
4950 html = '<h3>[' + data.label + ']</h3>' + data.html;
5051 } else {

Follow-up revisions

RevisionCommit summaryAuthorDate
r114206MFT r114134, r114136, r114144, r114145, r114150, r114152, r114157awjrichards22:26, 19 March 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r114134make references close on a second click...jdlrobson13:03, 19 March 2012

Status & tagging log