]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
prevent dropdowns from closing when clicking inside form element inside dropdown
authorJacob Thornton <jacobthornton@gmail.com>
Tue, 20 Mar 2012 06:13:55 +0000 (23:13 -0700)
committerJacob Thornton <jacobthornton@gmail.com>
Tue, 20 Mar 2012 06:13:55 +0000 (23:13 -0700)
docs/assets/bootstrap.zip
docs/assets/js/bootstrap-dropdown.js
docs/assets/js/bootstrap-typeahead.js
js/bootstrap-dropdown.js
js/bootstrap-typeahead.js

index 84b91830fede29a56452472c6b1391d4ddb0c6f2..b23cd19c97c6bb27c4f5eddcd364037cb2abf7d8 100644 (file)
Binary files a/docs/assets/bootstrap.zip and b/docs/assets/bootstrap.zip differ
index 54b61c5e9d00da2347da8847c8baaa079dd4f196..f26b83f41dc6774a260d2365a5716c88cf25f8d5 100644 (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 );
\ No newline at end of file
index 804e60dc446cbb65ccd00798625c739c4e0bc2ea..f4d26186c7191d940f45b845030045c6360347b8 100644 (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()
     }
 
index 54b61c5e9d00da2347da8847c8baaa079dd4f196..f26b83f41dc6774a260d2365a5716c88cf25f8d5 100644 (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 );
\ No newline at end of file
index 804e60dc446cbb65ccd00798625c739c4e0bc2ea..f4d26186c7191d940f45b845030045c6360347b8 100644 (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()
     }