diff options
Diffstat (limited to 'misc/tableselect.js')
-rw-r--r-- | misc/tableselect.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/misc/tableselect.js b/misc/tableselect.js index 5020f7931..5c0cfbb32 100644 --- a/misc/tableselect.js +++ b/misc/tableselect.js @@ -2,10 +2,11 @@ Drupal.tableSelect = function() { // Keep track of the table, which checkbox is checked and alias the settings. - var table = this, selectAll, checkboxes, lastChecked, settings = Drupal.settings.tableSelect; + var table = this, selectAll, checkboxes, lastChecked; + var strings = { 'selectAll': Drupal.t('Select all rows in this table'), 'selectNone': Drupal.t('Deselect all rows in this table') }; // Store the select all checkbox in a variable as we need it quite often. - selectAll = $('<input type="checkbox" class="form-checkbox" />').attr('title', settings.selectAll).click(function() { + selectAll = $('<input type="checkbox" class="form-checkbox" />').attr('title', strings.selectAll).click(function() { // Loop through all checkboxes and set their state to the select all checkbox' state. checkboxes.each(function() { this.checked = selectAll[0].checked; @@ -13,7 +14,7 @@ Drupal.tableSelect = function() { $(this).parents('tr:first')[ this.checked ? 'addClass' : 'removeClass' ]('selected'); }); // Update the title and the state of the check all box. - selectAll.attr('title', selectAll[0].checked ? settings.selectNone : settings.selectAll); + selectAll.attr('title', selectAll[0].checked ? strings.selectNone : strings.selectAll); }); // Find all <th> with class select-all, and insert the check all checkbox. @@ -35,7 +36,7 @@ Drupal.tableSelect = function() { // If all checkboxes are checked, make sure the select-all one is checked too, otherwise keep unchecked. selectAll[0].checked = (checkboxes.length == $(checkboxes).filter(':checked').length); // Set the title to the current action. - selectAll.attr('title', selectAll[0].checked ? settings.selectNone : settings.selectAll); + selectAll.attr('title', selectAll[0].checked ? strings.selectNone : strings.selectAll); // Keep track of the last checked checkbox. lastChecked = e.target; |