8000 Make it more robust when it's disabled. · f2er/jquery.transit@36a64d6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 36a64d6

Browse files
committed
Make it more robust when it's disabled.
1 parent 9b750ce commit 36a64d6

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

jquery.transit.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
*/
99

1010
(function($) {
11-
$.transit = { version: "0.0.1" };
11+
$.transit = {
12+
version: "0.0.1",
13+
enabled: true // Will simply transition "instantly" if false
14+
};
1215

1316
var div = document.createElement('div');
1417

@@ -401,9 +404,12 @@
401404
delete properties.delay;
402405
}
403406

407+
// True if transit should work using transitions.
408+
var work = $.transit.enabled && support.transition;
409+
404410
// Compute delay until callback.
405411
// If this becomes 0, don't bother setting the transition property.
406-
var i = support.transition ? (parseInt(duration) + parseInt(delay)) : 0;
412+
var i = work ? (parseInt(duration) + parseInt(delay)) : 0;
407413

408414
// Save the old transitions of each element so we can restore it later.
409415
var oldTransitions = {};

site/test.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,6 @@ title: Your new Proton site
613613

614614
window.setTimeout(function() {
615615
a(x == 2);
616-
}, 600);
616+
}, 1600);
617617
},
618618
});

0 commit comments

Comments
 (0)
0