0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-17 09:52:29 +01:00

prevent dropdowns from closing when clicking inside form element inside dropdown

This commit is contained in:
Jacob Thornton 2012-03-19 23:13:55 -07:00
parent 63bd7cb478
commit 663e41d74f
5 changed files with 12 additions and 6 deletions

Binary file not shown.

View File

@ -86,7 +86,9 @@
$(function () {
$('html').on('click.dropdown.data-api', clearMenus)
$('body').on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
$('body')
.on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
.on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
})
}( window.jQuery );

View File

@ -39,8 +39,9 @@
, select: function () {
var val = this.$menu.find('.active').attr('data-value')
this.$element.val(val)
this.$element.change();
this.$element
.val(val)
.change()
return this.hide()
}

View File

@ -86,7 +86,9 @@
$(function () {
$('html').on('click.dropdown.data-api', clearMenus)
$('body').on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
$('body')
.on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
.on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
})
}( window.jQuery );

View File

@ -39,8 +39,9 @@
, select: function () {
var val = this.$menu.find('.active').attr('data-value')
this.$element.val(val)
this.$element.change();
this.$element
.val(val)
.change()
return this.hide()
}