From bb0a03c0b79532e842bd29f4dbfe32eb8be23840 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=2E=20Rene=CC=81e=20Beach?= <splendidnoise@gmail.com>
Date: Tue, 19 Nov 2013 17:24:51 -0500
Subject: [PATCH] Issue #2139571
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: J. Renée Beach <splendidnoise@gmail.com>
---
 core/modules/toolbar/js/toolbar.js | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/core/modules/toolbar/js/toolbar.js b/core/modules/toolbar/js/toolbar.js
index d94fde6..b1b785e 100644
--- a/core/modules/toolbar/js/toolbar.js
+++ b/core/modules/toolbar/js/toolbar.js
@@ -203,10 +203,10 @@ Drupal.toolbar = {
     defaults: {
       // The active toolbar tab. All other tabs should be inactive under
       // normal circumstances. It will remain active across page loads. The
-      // active item is stored as a DOM element, not a jQuery set.
+      // active item is stored as an ID selector e.g. '#navbar-item--1'.
       activeTab: null,
-      // Represents whether a tray is open or not. Stored as a DOM element, not
-      // a jQuery set.
+      // Represents whether a tray is open or not. Stored as an ID selector e.g.
+      // '#navbar-item--1-tray'.
       activeTray: null,
       // Indicates whether the toolbar is displayed in an oriented fashion,
       // either horizontal or vertical.
@@ -375,8 +375,9 @@ Drupal.toolbar = {
       // activatable tab.
       if (event.target.hasAttribute('data-toolbar-tray')) {
         var tab = this.model.get('activeTab');
+        var id = '#' + event.target.id;
         // Set the event target as the active item if it is not already.
-        this.model.set('activeTab', (!tab || event.target !== tab) ? event.target : null);
+        this.model.set('activeTab', (!tab || id !== tab) ? id : null);
 
         event.preventDefault();
         event.stopPropagation();
-- 
1.8.2

