Push dev work to master #2

Merged
sixteenmillimeter merged 416 commits from dev into master 2018-07-19 15:29:02 +00:00
1 changed files with 13 additions and 7 deletions
Showing only changes of commit 64b0244972 - Show all commits

View File

@ -39,17 +39,20 @@ sequence.start = function (options, cb) {
} else {
sequence._loop.max = 0
}
sequence._state.stop = cb
sequence.step()
}
sequence.stop = function (next) {
sequence.setStop = function () {
sequence._state.active = false
}
sequence.stop = function () {
sequence._state.active = false
sequence._state.count = 0
sequence._loop.count = 0
console.dir(sequence._state.stop)
console.trace()
if (next) next()
if (sequence._state.stop) sequence._state.stop()
sequence._state.stop = null
}
sequence.pause = function () {
@ -63,12 +66,15 @@ sequence.resume = function () {
sequence.step = function () {
if (sequence._state.active && !sequence._state.paused) {
if (sequence._state.arr.length > 0 && typeof sequence._state.arr[sequence._state.count] !== 'undefined') {
if (sequence._state.arr.length > 0) {
if (sequence._state.count > sequence._state.arr.length) {
return sequence.stop()
}
return sequence._state.arr[sequence._state.count](() => {
sequence._state.count++
sequence.step()
})
} else if (sequence._loop.arr.length > 0 && typeof sequence._loop.arr[sequence._state.count] !== 'undefined') {
} else if (sequence._loop.arr.length > 0) {
if (sequence._state.count > sequence._loop.arr.length) {
sequence._state.count = 0
sequence._loop.count++