vendor/assets/javascripts/dropdown.js in flashgrid-2.2.0 vs vendor/assets/javascripts/dropdown.js in flashgrid-2.2.5
- old
+ new
@@ -31,11 +31,13 @@
var relatedTarget = { relatedTarget: this }
$parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
if (e.isDefaultPrevented()) return
- $this.trigger('focus')
+ $this
+ .trigger('focus')
+ .attr('aria-expanded', 'true')
$parent
.toggleClass('open')
.trigger('shown.bs.dropdown', relatedTarget)
}
@@ -77,14 +79,20 @@
function clearMenus(e) {
if (e && e.which === 3) return
$(backdrop).remove()
$(toggle).each(function () {
- var $parent = getParent($(this))
+ var $this = $(this)
+ var $parent = getParent($this)
var relatedTarget = { relatedTarget: this }
+
if (!$parent.hasClass('open')) return
+
$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
+
if (e.isDefaultPrevented()) return
+
+ $this.attr('aria-expanded', 'false')
$parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
})
}
function getParent($this) {
\ No newline at end of file