From ea56c37ca9674f0155448699918650bbfcfbb888 Mon Sep 17 00:00:00 2001 From: Thomas Park Date: Tue, 16 Jun 2015 21:40:15 -0400 Subject: update bootstrap to 3.3.5 --- .../assets/javascripts/bootstrap/dropdown.js | 88 +++++++++++----------- 1 file changed, 46 insertions(+), 42 deletions(-) (limited to 'bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/dropdown.js') diff --git a/bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/dropdown.js b/bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/dropdown.js index 9874600f..bc4d3734 100644 --- a/bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/dropdown.js +++ b/bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/dropdown.js @@ -1,5 +1,5 @@ /* ======================================================================== - * Bootstrap: dropdown.js v3.3.4 + * Bootstrap: dropdown.js v3.3.5 * http://getbootstrap.com/javascript/#dropdowns * ======================================================================== * Copyright 2011-2015 Twitter, Inc. @@ -19,7 +19,41 @@ $(element).on('click.bs.dropdown', this.toggle) } - Dropdown.VERSION = '3.3.4' + Dropdown.VERSION = '3.3.5' + + function getParent($this) { + var selector = $this.attr('data-target') + + if (!selector) { + selector = $this.attr('href') + selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 + } + + var $parent = selector && $(selector) + + return $parent && $parent.length ? $parent : $this.parent() + } + + function clearMenus(e) { + if (e && e.which === 3) return + $(backdrop).remove() + $(toggle).each(function () { + var $this = $(this) + var $parent = getParent($this) + var relatedTarget = { relatedTarget: this } + + if (!$parent.hasClass('open')) return + + if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) 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) + }) + } Dropdown.prototype.toggle = function (e) { var $this = $(this) @@ -34,7 +68,10 @@ if (!isActive) { if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { // if mobile we use a backdrop because click events don't delegate - $('