vendor/assets/javascripts/twitter/bootstrap/dropdown.js in anjlab-bootstrap-rails-2.2.2.rc1 vs vendor/assets/javascripts/twitter/bootstrap/dropdown.js in anjlab-bootstrap-rails-2.2.2.0

- old
+ new

@@ -51,13 +51,14 @@ clearMenus() if (!isActive) { $parent.toggleClass('open') - $this.focus() } + $this.focus() + return false } , keydown: function (e) { var $this @@ -80,11 +81,11 @@ isActive = $parent.hasClass('open') if (!isActive || (isActive && e.keyCode == 27)) return $this.click() - $items = $('[role=menu] li:not(.divider) a', $parent) + $items = $('[role=menu] li:not(.divider):visible a', $parent) if (!$items.length) return index = $items.index($items.filter(':focus')) @@ -122,19 +123,30 @@ /* DROPDOWN PLUGIN DEFINITION * ========================== */ + var old = $.fn.dropdown + $.fn.dropdown = function (option) { return this.each(function () { var $this = $(this) , data = $this.data('dropdown') if (!data) $this.data('dropdown', (data = new Dropdown(this))) if (typeof option == 'string') data[option].call($this) }) } $.fn.dropdown.Constructor = Dropdown + + + /* DROPDOWN NO CONFLICT + * ==================== */ + + $.fn.dropdown.noConflict = function () { + $.fn.dropdown = old + return this + } /* APPLY TO STANDARD DROPDOWN ELEMENTS * =================================== */ \ No newline at end of file