amitabhaghosh197
7/9/2014 - 12:51 PM

bootstrap 2.3.2 make dropdown menu open when clicked

bootstrap 2.3.2 make dropdown menu open when clicked

// 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;
   });