diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-03-13 23:15:09 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-03-13 23:15:09 +0000 |
commit | b77475baf5eee88f7ca08adaf53c7c5eda6aca58 (patch) | |
tree | 4a1bf4029dc06956ceaa9c7373dbabb85e4dc3d0 /modules/simpletest | |
parent | 35794257c39c915f15c23b968cd9edd166a12696 (diff) | |
download | brdo-b77475baf5eee88f7ca08adaf53c7c5eda6aca58.tar.gz brdo-b77475baf5eee88f7ca08adaf53c7c5eda6aca58.tar.bz2 |
#360081 by quicksketch: Stop using global variables for JavaScript settings.
Diffstat (limited to 'modules/simpletest')
-rw-r--r-- | modules/simpletest/simpletest.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/modules/simpletest/simpletest.js b/modules/simpletest/simpletest.js index 9026de11b..06fb70f30 100644 --- a/modules/simpletest/simpletest.js +++ b/modules/simpletest/simpletest.js @@ -5,18 +5,18 @@ * Add the cool table collapsing on the testing overview page. */ Drupal.behaviors.simpleTestMenuCollapse = { - attach: function() { + attach: function(context, settings) { var timeout = null; // Adds expand-collapse functionality. $('div.simpletest-image').each(function() { - direction = Drupal.settings.simpleTest[$(this).attr('id')].imageDirection; - $(this).html(Drupal.settings.simpleTest.images[direction]); + direction = settings.simpleTest[$(this).attr('id')].imageDirection; + $(this).html(settings.simpleTest.images[direction]); }); // Adds group toggling functionality to arrow images. $('div.simpletest-image').click(function() { - var trs = $(this).parents('tbody').children('.' + Drupal.settings.simpleTest[this.id].testClass); - var direction = Drupal.settings.simpleTest[this.id].imageDirection; + var trs = $(this).parents('tbody').children('.' + settings.simpleTest[this.id].testClass); + var direction = settings.simpleTest[this.id].imageDirection; var row = direction ? trs.size() - 1 : 0; // If clicked in the middle of expanding a group, stop so we can switch directions. @@ -48,8 +48,8 @@ Drupal.behaviors.simpleTestMenuCollapse = { rowToggle(); // Toggle the arrow image next to the test group title. - $(this).html(Drupal.settings.simpleTest.images[(direction ? 0 : 1)]); - Drupal.settings.simpleTest[this.id].imageDirection = !direction; + $(this).html(settings.simpleTest.images[(direction ? 0 : 1)]); + settings.simpleTest[this.id].imageDirection = !direction; }); } @@ -60,9 +60,9 @@ Drupal.behaviors.simpleTestMenuCollapse = { * selected/deselected. */ Drupal.behaviors.simpleTestSelectAll = { - attach: function() { + attach: function(context, settings) { $('td.simpletest-select-all').each(function() { - var testCheckboxes = Drupal.settings.simpleTest['simpletest-test-group-' + $(this).attr('id')].testNames; + var testCheckboxes = settings.simpleTest['simpletest-test-group-' + $(this).attr('id')].testNames; var groupCheckbox = $('<input type="checkbox" class="form-checkbox" id="' + $(this).attr('id') + '-select-all" />'); // Each time a single-test checkbox is checked or unchecked, make sure |