From 057c0867c75b2f69a399234a874d226c7d6d76a6 Mon Sep 17 00:00:00 2001 From: Pierre Bertet Date: Sat, 26 Apr 2014 22:54:02 +0100 Subject: [PATCH] Fixed transitions on some Android 4.1 devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On some devices (tested on a Samsung Galaxy S2), Android 4.1 is erroneously reporting to support unprefixed transitions events, while it’s in fact not implemented. The solution is to test for the prefixed version first. The WebKit-prefixed event has been moved on top of the tested events, and while the Object properties order is not guaranteed in JavaScript (ES3, section 4.3.3), it is the case in the targeted browser. --- src/transition.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/transition.js b/src/transition.js index d708b36743f..4cc461af9dd 100644 --- a/src/transition.js +++ b/src/transition.js @@ -208,9 +208,9 @@ function sniffEndEvents () { var el = document.createElement('vue'), defaultEvent = 'transitionend', events = { + 'webkitTransition' : 'webkitTransitionEnd', 'transition' : defaultEvent, - 'mozTransition' : defaultEvent, - 'webkitTransition' : 'webkitTransitionEnd' + 'mozTransition' : defaultEvent }, ret = {} for (var name in events) {