vendor/assets/javascripts/dropdown.js in flashgrid-1.0.20 vs vendor/assets/javascripts/dropdown.js in flashgrid-1.0.21

- old
+ new

@@ -3,11 +3,11 @@ // DROPDOWN CLASS DEFINITION // ========================= 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) } Dropdown.prototype.toggle = function (e) { @@ -33,11 +33,11 @@ $parent .toggleClass('open') .trigger('shown.bs.dropdown', relatedTarget) - $this.focus() + $this.trigger('focus') } return false } @@ -53,26 +53,26 @@ var $parent = getParent($this) var isActive = $parent.hasClass('open') if (!isActive || (isActive && e.keyCode == 27)) { - if (e.which == 27) $parent.find(toggle).focus() - return $this.click() + if (e.which == 27) $parent.find(toggle).trigger('focus') + return $this.trigger('click') } 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 var index = $items.index($items.filter(':focus')) if (e.keyCode == 38 && index > 0) index-- // up if (e.keyCode == 40 && index < $items.length - 1) index++ // down if (!~index) index = 0 - $items.eq(index).focus() + $items.eq(index).trigger('focus') } function clearMenus(e) { $(backdrop).remove() $(toggle).each(function () { @@ -131,8 +131,8 @@ $(document) .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); \ No newline at end of file