Prev step final API (#268)

* 1.7.0

* fix the api

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* fixes #266

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* finally got this to work! Phew :D

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* remove extra log

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* getStepAPI in insertStep

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* add getPreviousStep API

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* more api

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* changes and refactor

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* now using this.getStep and related functions

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* add getNextStep

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* minor refactor

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* fix

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* update getIndex

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>
This commit is contained in:
Varun Gupta
2018-05-28 11:03:17 +05:30
committed by Jeffrey Warren
parent 58a4798674
commit 1de72d7325
11 changed files with 267 additions and 115 deletions

View File

@@ -1,3 +1,5 @@
const getStepUtils = require('./util/getStep.js');
// insert one or more steps at a given index in the sequencer
function InsertStep(ref, image, index, name, o) {
@@ -22,10 +24,7 @@ function InsertStep(ref, image, index, name, o) {
options: o
};
var UI = ref.events;
this.getStep = function getStep(offset) {
return ref.images[image].steps.slice(offset)[0];
}
var module = ref.modules[name][0].bind(this)(o, UI);
var module = ref.modules[name][0](o, UI);
ref.images[image].steps.splice(index, 0, module);
return true;