Skip to content

Commit

Permalink
Merge pull request #12948 from twbs/js-quote-attr-vals
Browse files Browse the repository at this point in the history
use quotes around all element attribute values in JS
  • Loading branch information
cvrebert committed Mar 6, 2014
2 parents 4db5164 + 297303a commit 839f8fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions js/collapse.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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')
}

Expand Down
6 changes: 3 additions & 3 deletions js/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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);

0 comments on commit 839f8fa

Please sign in to comment.