diff options
author | Maxime Quandalle <maxime@quandalle.com> | 2015-06-12 13:59:39 +0200 |
---|---|---|
committer | Maxime Quandalle <maxime@quandalle.com> | 2015-06-12 17:48:15 +0200 |
commit | c8945679872a0708eb67a477a99a65d508c84cb0 (patch) | |
tree | 5cf9f2cc842f891451f7bc247b5f0833c1ab39e7 /client/lib | |
parent | 216887490e3be0ba141484afc11d37475e91562d (diff) | |
download | wekan-c8945679872a0708eb67a477a99a65d508c84cb0.tar.gz wekan-c8945679872a0708eb67a477a99a65d508c84cb0.tar.bz2 wekan-c8945679872a0708eb67a477a99a65d508c84cb0.zip |
Work on the card activities and comments
This commit also introduces a new CSSEvents object that is used to
abstract vendor specifics events related to CSS transitions and
animations.
Fixes #183.
Fixes #179.
Diffstat (limited to 'client/lib')
-rw-r--r-- | client/lib/cssEvents.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/client/lib/cssEvents.js b/client/lib/cssEvents.js new file mode 100644 index 00000000..487ba69b --- /dev/null +++ b/client/lib/cssEvents.js @@ -0,0 +1,42 @@ +// XXX Should we use something like Moderniz instead of our custom detector? + +var whichTransitionEvent = function() { + var t; + var el = document.createElement('fakeelement'); + var transitions = { + transition:'transitionend', + OTransition:'oTransitionEnd', + MSTransition:'msTransitionEnd', + MozTransition:'transitionend', + WebkitTransition:'webkitTransitionEnd' + }; + + for (t in transitions) { + if (el.style[t] !== undefined) { + return transitions[t]; + } + } +}; + +var whichAnimationEvent = function() { + var t; + var el = document.createElement('fakeelement'); + var transitions = { + animation:'animationend', + OAnimation:'oAnimationEnd', + MSTransition:'msAnimationEnd', + MozAnimation:'animationend', + WebkitAnimation:'webkitAnimationEnd' + }; + + for (t in transitions) { + if (el.style[t] !== undefined) { + return transitions[t]; + } + } +}; + +CSSEvents = { + transitionend: whichTransitionEvent(), + animationend: whichAnimationEvent() +}; |