From dcc64f44f9f81d32c8071c6bdac86546eaeb57a0 Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Wed, 27 May 2015 17:17:00 +0200 Subject: UI improvements * Implement visibility choice on board creation; * Rework the board header bar. Remove links to un-implemented features; * Implement a board star counter (visible if the board have >2 stars); * Define a new icon (a thin cross) to close elements; * Remove $(document).on('mouseover') event handlers that were basically fired hundreds of times for nothing, we now define a proper Tracker dependency to execute jquery-ui plugin initialization only when something has changed; * Bug fixes related to list scrolling. --- client/components/main/popup.js | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'client/components/main/popup.js') diff --git a/client/components/main/popup.js b/client/components/main/popup.js index 8abe1697..48847525 100644 --- a/client/components/main/popup.js +++ b/client/components/main/popup.js @@ -1,11 +1,21 @@ // XXX This event list must be abstracted somewhere else. -var endTransitionEvents = [ - 'webkitTransitionEnd', - 'otransitionend', - 'oTransitionEnd', - 'msTransitionEnd', - 'transitionend' -].join(' '); +function whichTransitionEvent() { + var t; + var el = document.createElement('fakeelement'); + var transitions = { + transition:'transitionend', + OTransition:'oTransitionEnd', + MozTransition:'transitionend', + WebkitTransition:'webkitTransitionEnd' + }; + + for (t in transitions) { + if (el.style[t] !== undefined) { + return transitions[t]; + } + } +} +var transitionEvent = whichTransitionEvent(); Popup.template.events({ click: function(evt) { @@ -32,7 +42,7 @@ Popup.template.onRendered(function() { container._uihooks = { removeElement: function(node) { $(node).addClass('no-height'); - $(container).one(endTransitionEvents, function() { + $(container).one(transitionEvent, function() { node.parentNode.removeChild(node); }); } -- cgit v1.2.3-1-g7c22