bootstrap-collapse.js shouldn't rely only on transition end event
Created by: victor-homyakov
Currently methods Collapse#show()
, Collapse#hide()
, Collapse#transition()
rely only on transition end event, and will have broken inner state and stop work if such event wasn't fired for some reason:
- Element has method
hide()
, which actually hides element, thus preventing transition (http://api.prototypejs.org/dom/Element/prototype/hide/). - Transition is aborted because the animating property's value is changed before the transition is completed (https://developer.mozilla.org/en-US/docs/CSS/Using_CSS_transitions#Detecting_the_completion_of_a_transition).
- Browser vendor changes transition end event name/event system, as it already was with Opera (http://www.ianlunn.co.uk/blog/articles/opera-12-otransitionend-bugs-and-workarounds/).
(for more info please read my answer to http://stackoverflow.com/questions/12715254/twitter-bootstrap-transition-conflict-prototypejs)
Invokation of callback complete()
in Collapse#transition()
should be guaranteed even if transition event wasn't fired, e.g. via setTimeout()
.