Skip to content

Commit 255deed

Browse files
author
daniel-lundin
committed
Fixed manual mode complete bug
1 parent 4fdac7a commit 255deed

File tree

7 files changed

+20
-32
lines changed

7 files changed

+20
-32
lines changed

docs/docs.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,17 +144,17 @@ $(function() {
144144

145145
snabbt.sequence([
146146
[elementTwo, {
147-
position: [100, 0, 0],
147+
position: [100, 0, 0]
148148
}],
149149
[elementOne, {
150-
position: [100, 0, 0],
150+
position: [100, 0, 0]
151151
}],
152152
[elementOne, {
153-
position: [0, 0, 0],
153+
position: [0, 0, 0]
154154
}],
155155
[elementTwo, {
156-
position: [0, 0, 0],
157-
}],
156+
position: [0, 0, 0]
157+
}]
158158
]
159159
);
160160
});
@@ -329,7 +329,6 @@ $(function() {
329329
});
330330
}
331331

332-
333332
if (event.isFinal) {
334333
if (animations) {
335334
if (delta > 0.5) {

docs/snabbt.min.js

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "snabbt.js",
3-
"version": "0.6.3",
3+
"version": "0.6.4",
44
"description": "Fast animations with javascript and CSS-transforms",
55
"main": "snabbt.js",
66
"files": [

snabbt.js

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* snabbt.js Version: 0.6.3 Build date: 2015-12-17 (c) 2015 Daniel Lundin @license MIT */
1+
/* snabbt.js Version: 0.6.4 Build date: 2015-12-27 (c) 2015 Daniel Lundin @license MIT */
22
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.snabbt = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
33
// Array.prototype.find - MIT License (c) 2013 Paul Miller <http://paulmillr.com>
44
// For all details and docs: https://github.com/paulmillr/array.prototype.find
@@ -128,7 +128,7 @@ function createAnimation(startState, _endState, options, transformProperty) {
128128

129129
setValue: function setValue(_manualValue) {
130130
started = true;
131-
manualValue = Math.min(Math.max(_manualValue, 0.0001), 1 + manualDelayFactor);
131+
manualValue = Math.min(Math.max(_manualValue, 0.0001), 0.9999 + manualDelayFactor);
132132
},
133133

134134
updateCurrentTransform: function updateCurrentTransform() {
@@ -616,11 +616,12 @@ module.exports = function (element, arg2, arg3) {
616616
module.exports.createMatrix = createMatrix;
617617
module.exports.setElementTransform = updateElementTransform;
618618
module.exports.sequence = function (queue) {
619-
var i = 0;
619+
var i = -1;
620620

621621
var next = function next() {
622622
++i;
623623
if (i > queue.length - 1) return;
624+
624625
var element = queue[i][0];
625626
var options = queue[i][1];
626627

@@ -631,14 +632,7 @@ module.exports.sequence = function (queue) {
631632
snabbt(element, options);
632633
};
633634

634-
var element = queue[0][0];
635-
var options = queue[0][1];
636-
var previousAllDone = options.allDone;
637-
options.allDone = previousAllDone ? function () {
638-
previousAllDone();next();
639-
} : next;
640-
641-
snabbt(element, options);
635+
next();
642636
};
643637

644638
if (typeof window !== 'undefined' && window.jQuery) {

snabbt.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/animation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function createAnimation(startState, endState, options, transformProperty) {
9292

9393
setValue(_manualValue) {
9494
started = true;
95-
manualValue = Math.min(Math.max(_manualValue, 0.0001), 1 + manualDelayFactor);
95+
manualValue = Math.min(Math.max(_manualValue, 0.0001), 0.9999 + manualDelayFactor);
9696
},
9797

9898
updateCurrentTransform() {

src/main.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,26 +68,22 @@ module.exports = function(element, arg2, arg3) {
6868
module.exports.createMatrix = createMatrix;
6969
module.exports.setElementTransform = updateElementTransform;
7070
module.exports.sequence = (queue) => {
71-
let i = 0;
71+
let i = -1;
7272

7373
const next = () => {
7474
++i;
7575
if (i > queue.length - 1)
7676
return;
77+
7778
const element = queue[i][0];
7879
const options = queue[i][1];
7980

8081
const previousAllDone = options.allDone;
81-
options.allDone = previousAllDone ? () => { previousAllDone(); next() } : next;
82+
options.allDone = previousAllDone ? () => { previousAllDone(); next(); } : next;
8283
snabbt(element, options);
83-
}
84-
85-
const element = queue[0][0];
86-
const options = queue[0][1];
87-
const previousAllDone = options.allDone;
88-
options.allDone = previousAllDone ? () => { previousAllDone(); next() } : next;
84+
};
8985

90-
snabbt(element, options);
86+
next();
9187
};
9288

9389
if (typeof window !== 'undefined' && window.jQuery) {

0 commit comments

Comments
 (0)