r49074 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49073‎ | r49074 | r49075 >
Date:14:22, 31 March 2009
Author:jojo
Status:resolved (Comments)
Tags:
Comment:
make enabling/disabling more robust
Modified paths:
  • /trunk/extensions/Collection/collection/popup.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Collection/collection/popup.js
@@ -6,7 +6,7 @@
77 document.write('<script type="text/javascript" src="' + wgCollectionNavPopupJSURL + '"></script>');
88 importStylesheetURI(wgCollectionNavPopupCSSURL);
99
10 -var createBookMode = false;
 10+var createBookMode = null;
1111 var collectionArticleList = [];
1212 var collectionPopup;
1313
@@ -110,7 +110,7 @@
111111
112112 // stop popups
113113 function stopCollectionPopups() {
114 - if (createBookMode) {
 114+ if (createBookMode != false) {
115115 var bodyDiv = document.getElementById("bodyContent");
116116 var links = bodyDiv.getElementsByTagName('a');
117117 for (var i = 0; i < links.length; i++) {
@@ -123,7 +123,7 @@
124124
125125 // start popups
126126 function startCollectionPopups() {
127 - if (!createBookMode) {
 127+ if (createBookMode != true) {
128128 var bodyDiv = document.getElementById("bodyContent");
129129 var links = bodyDiv.getElementsByTagName('a');
130130 for (var i = 0; i < links.length; i++) {

Comments

#Comment by Brion VIBBER (talk | contribs)   20:35, 4 May 2009

This is confusing to me... What's the purpose of this change? What does it make more robust exactly?

#Comment by Jbeigel (talk | contribs)   12:56, 3 June 2009

The code is now using three-value logic: null (= previously unset), false (= off) and true (= on)

Status & tagging log