summaryrefslogtreecommitdiff
path: root/modules/toolbar
diff options
context:
space:
mode:
Diffstat (limited to 'modules/toolbar')
-rw-r--r--modules/toolbar/toolbar.js14
1 files changed, 4 insertions, 10 deletions
diff --git a/modules/toolbar/toolbar.js b/modules/toolbar/toolbar.js
index 7b804182f..c19010039 100644
--- a/modules/toolbar/toolbar.js
+++ b/modules/toolbar/toolbar.js
@@ -8,18 +8,12 @@ Drupal.behaviors.admin = {
attach: function() {
// Set the intial state of the toolbar.
- $('#toolbar:not(.processed)').each(function() {
- Drupal.admin.toolbar.init();
- $(this).addClass('processed');
- });
+ $('#toolbar', context).once('toolbar', Drupal.admin.toolbar.init);
// Toggling of admin shortcuts visibility.
- $('#toolbar span.toggle:not(.processed)').each(function() {
- $(this).click(function() {
- Drupal.admin.toolbar.toggle();
- return false;
- });
- $(this).addClass('processed');
+ $('#toolbar span.toggle', context).once('toolbar-toggle').click(function() {
+ Drupal.admin.toolbar.toggle();
+ return false;
});
}
};