From 297303a7cc73188d127cc7ac2f116e5c02feab1d Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Thu, 6 Mar 2014 11:12:17 -0800 Subject: [PATCH] use quotes around all element attr vals in JS; fixes #12946 --- js/collapse.js | 4 ++-- js/dropdown.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/js/collapse.js b/js/collapse.js index 7130282b08..6907dda3a4 100644 --- a/js/collapse.js +++ b/js/collapse.js @@ -148,7 +148,7 @@ // COLLAPSE DATA-API // ================= - $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) { + $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) { var $this = $(this), href var target = $this.attr('data-target') || e.preventDefault() @@ -160,7 +160,7 @@ var $parent = parent && $(parent) if (!data || !data.transitioning) { - if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed') + if ($parent) $parent.find('[data-toggle="collapse"][data-parent="' + parent + '"]').not($this).addClass('collapsed') $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed') } diff --git a/js/dropdown.js b/js/dropdown.js index 6e206a0d16..b35ce562d0 100644 --- a/js/dropdown.js +++ b/js/dropdown.js @@ -14,7 +14,7 @@ // ========================= var backdrop = '.dropdown-backdrop' - var toggle = '[data-toggle=dropdown]' + var toggle = '[data-toggle="dropdown"]' var Dropdown = function (element) { $(element).on('click.bs.dropdown', this.toggle) } @@ -69,7 +69,7 @@ } var desc = ' li:not(.divider):visible a' - var $items = $parent.find('[role=menu]' + desc + ', [role=listbox]' + desc) + var $items = $parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc) if (!$items.length) return @@ -142,6 +142,6 @@ .on('click.bs.dropdown.data-api', clearMenus) .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle) - .on('keydown.bs.dropdown.data-api', toggle + ', [role=menu], [role=listbox]', Dropdown.prototype.keydown) + .on('keydown.bs.dropdown.data-api', toggle + ', [role="menu"], [role="listbox"]', Dropdown.prototype.keydown) }(jQuery);