r96412 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96411‎ | r96412 | r96413 >
Date:09:24, 7 September 2011
Author:junaidpv
Status:ok
Tags:
Comment:
Stoppin further actions if no schemes, fix for r96186
Modified paths:
  • /trunk/extensions/Narayam/js/ext.narayam.core.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Narayam/js/ext.narayam.core.js
@@ -385,8 +385,12 @@
386386 * from a cookie or wgNarayamEnableByDefault
387387 */
388388 this.setup = function() {
389 - //build the menu.
390 - that.buildMenu();
 389+ // Build the menu
 390+ if ( !that.buildMenu() ){
 391+ // /buildMenu() returned false
 392+ // No need to proceed
 393+ return;
 394+ }
391395
392396 // Restore state from cookies
393397 var savedScheme = $.cookie( 'narayam-scheme' );
@@ -439,7 +443,8 @@
440444
441445 if ( !haveSchemes ) {
442446 // No schemes available, don't show the tool
443 - return;
 447+ // So return false
 448+ return false;
444449 }
445450
446451 // Event listener for scheme selection.
@@ -507,7 +512,10 @@
508513 },function(){
509514 $("#searchform").css({ visibility: "visible" });
510515 });
511 - }
 516+ }
 517+
 518+ // Narayam controls setup complete, returns true
 519+ return true;
512520 }
513521
514522 } )();

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r96186Refactor the code for building the menu to buildMenu.santhosh14:06, 3 September 2011

Status & tagging log