CLEANUP: This file no longer seems to be used
This commit is contained in:
parent
de73e9fb56
commit
5c2893c8f9
|
@ -1,43 +0,0 @@
|
||||||
/**
|
|
||||||
CSS transitions are a PITA, often we need to queue some js after a transition, this helper ensures
|
|
||||||
it happens after the transition.
|
|
||||||
|
|
||||||
SO: http://stackoverflow.com/questions/9943435/css3-animation-end-techniques
|
|
||||||
|
|
||||||
|
|
||||||
@class TransitionHelper
|
|
||||||
@namespace Discourse
|
|
||||||
@module Discourse
|
|
||||||
**/
|
|
||||||
|
|
||||||
var dummy, eventNameHash, transitionEnd, _getTransitionEndEventName;
|
|
||||||
|
|
||||||
dummy = document.createElement("div");
|
|
||||||
|
|
||||||
eventNameHash = {
|
|
||||||
webkit: "webkitTransitionEnd",
|
|
||||||
Moz: "transitionend",
|
|
||||||
O: "oTransitionEnd",
|
|
||||||
ms: "MSTransitionEnd"
|
|
||||||
};
|
|
||||||
|
|
||||||
_getTransitionEndEventName = function() {
|
|
||||||
var retValue;
|
|
||||||
retValue = "transitionend";
|
|
||||||
Object.keys(eventNameHash).some(function(vendor) {
|
|
||||||
if (vendor + "TransitionProperty" in dummy.style) {
|
|
||||||
retValue = eventNameHash[vendor];
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return retValue;
|
|
||||||
};
|
|
||||||
transitionEnd = _getTransitionEndEventName();
|
|
||||||
|
|
||||||
Discourse.TransitionHelper = {
|
|
||||||
after: function(element, callback) {
|
|
||||||
return $(element).on(transitionEnd, callback);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue