Last active
August 29, 2015 14:03
-
-
Save amitabhaghosh197/dd7514263c59ed460f61 to your computer and use it in GitHub Desktop.
bootstrap 2.3.2 make dropdown menu open when clicked
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Source bootstrap.js | |
//Inspiration http://stackoverflow.com/questions/19740121/keep-bootstrap-dropdown-open-when-clicked-off | |
// Though the Inspiration is about bootstrap 3.0 | |
// It is often found that the dropdown-menu gets off when clicked inside. | |
// So it is the code to make the dropdown menu open when clicked inside. | |
// basically in bootstrap.js in the line 765 to 770 it is written | |
//$(document) | |
// .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus) | |
//.on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) | |
// .on('touchstart.dropdown.data-api', '.dropdown-menu', function (e) { e.stopPropagation() }) | |
//.on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle) | |
//.on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown) | |
// So it is required to remove the e.propagation from my targetted dropdown-menu class | |
// so the hack is | |
jQuery('.shop-buttons .dropdown-menu').on('click.dropdown touchstart.dropdown.data-api', function () { | |
return false; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment