From 23e3e6ef2bdcfbcdeb5712a60c96e89cafc8dd47 Mon Sep 17 00:00:00 2001
From: Henrik Hjelte
Date: Fri, 30 Aug 2013 07:33:44 +0100
Subject: [PATCH 1/3] Fix tests so they work with jQuery>2.0 as well as the
older versions Changed .live handlers to .click etc that works in all jQuery
versions
---
test/index.html | 1 +
test/test.js | 43 +++++++++++++++++++++++++------------------
2 files changed, 26 insertions(+), 18 deletions(-)
diff --git a/test/index.html b/test/index.html
index 7a847a8..5b9c893 100644
--- a/test/index.html
+++ b/test/index.html
@@ -33,6 +33,7 @@
Use:
+
jQ 2.0.3
jQ 1.9.0b1
jQ 1.8
jQ 1.7
diff --git a/test/test.js b/test/test.js
index ed88d03..a015441 100644
--- a/test/test.js
+++ b/test/test.js
@@ -1,25 +1,31 @@
(function($) {
/* Simple test framework of sorts */
- $('.test').live('mouseenter play', function() {
- var $test = $(this).closest('.test');
- $test.trigger('reset');
- var $box = $test.find('.box:not(.ghost)');
- var $ghost = $box.clone().addClass('ghost').appendTo($test.find('.area'));
- $test.data('code').fn($box, $test);
- });
- $('.test').live('mouseleave reset', function() {
- var $test = $(this).closest('.test');
- var $ghost = $test.find('.ghost');
- if ($ghost.length) {
- $test.find('.box:not(.ghost)').remove();
- $test.find('.ghost').removeClass('ghost');
- }
- });
-
- $('.play-all').live('click', function() {
- $('.test').trigger('play');
+ function addTestEvents ($test) {
+ $test.bind('mouseenter play', function() {
+ var $test = $(this).closest('.test');
+ $test.trigger('reset');
+ var $box = $test.find('.box:not(.ghost)');
+ var $ghost = $box.clone().addClass('ghost').appendTo($test.find('.area'));
+
+ $test.data('code').fn($box, $test);
+ });
+
+ $test.bind('mouseleave reset', function() {
+ var $test = $(this).closest('.test');
+ var $ghost = $test.find('.ghost');
+ if ($ghost.length) {
+ $test.find('.box:not(.ghost)').remove();
+ $test.find('.ghost').removeClass('ghost');
+ }
+ });
+ }
+
+ $(document).ready(function () {
+ $('.play-all').bind('click', function() {
+ $('.test').trigger('play');
+ });
});
function test(name, fn) {
@@ -36,6 +42,7 @@
$test.find('h3').html(name);
$test.find('pre').text(code);
$test.data('code', {fn: fn});
+ addTestEvents($test);
$('.tests').append($test);
}
From 91b8eef8af2de684e8e982cf4731c1db6209c162 Mon Sep 17 00:00:00 2001
From: Henrik Hjelte
Date: Fri, 30 Aug 2013 15:28:40 +0100
Subject: [PATCH 2/3] Testcase for transition of transform (Affects Webkit)
---
test/index.html | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/test/index.html b/test/index.html
index 5b9c893..ac4a924 100644
--- a/test/index.html
+++ b/test/index.html
@@ -158,6 +158,12 @@ jQuery transit tests
.transition({ opacity: 0 });
});
+ test('Transition of transform (no jump first time)', function($box) {
+ $box
+ .transition({ transform: "translateX(80px)" });
+ });
+
+