Refactor the way we open dropdowns in the collapsed right-sidebar
Refactor the way we open dropdowns from a collapsed right-sidebar to be more programmatic.
This worked by triggering a click on .edit-link in right_sidebar.js which goes to a hook that shows the selecbox/.dropdown-menu-toggle, then triggers a click in a setTimeout to actually show the dropdown.
With the "Move issue" dropdown, it used a different UI pattern and we didn't need all the bells and whistles of the selectbox. I refactored it out to triggering the click on a more general selector, .js-sidebar-dropdown-toggle, and left the .edit-link hook for the existing links that need to do some extra work.
This still requires the trigger click to be in a setTimeout because we need to wait for other clicky-ness in right_sidebar.js to settle otherwise the the bootstrap dropdown fires a hide event and we never see the dropdown. It's a bit more finicky than that but it is hard to describe.
It would be ideal if the right_sidebar.js code was programmatic/explicit instead of triggering clicks, trying to figure out how the code meshes together, and relying on this brittle relationships.
Bootstrap doesn't seem to have an official way to programmatically open the dropdown but Google suggests $('dropdown-toggle-selector').dropdown('toggle'); which seems to work ok (not perfect).


