diff --git a/dist/image-sequencer.js b/dist/image-sequencer.js index 621ca0d7..da8ea2bb 100644 --- a/dist/image-sequencer.js +++ b/dist/image-sequencer.js @@ -184151,6 +184151,7 @@ ImageSequencer = function ImageSequencer(options) { options = options || {}; options.inBrowser = options.inBrowser || typeof window !== 'undefined'; if (options.inBrowser) options.ui = options.ui || require('./UserInterface'); + options.initial_image = ""; var image, steps = [], @@ -184235,7 +184236,7 @@ ImageSequencer = function ImageSequencer(options) { image.onload = function() { run(image); if (callback) callback(image); - document.sequencer_image = image; + options.initial_image = image; } image.src = src; } @@ -184382,7 +184383,7 @@ module.exports = function ImageSelect(options) { image = new Image(); image.src = e.target.result; - document.sequencer_image = image; + options.initial_image = image; el.html(image); // may be redundant // this is done once per image: diff --git a/index.html b/index.html index f2da254c..69e26e43 100644 --- a/index.html +++ b/index.html @@ -74,7 +74,7 @@ $('.add-step').click(function(e) { e.preventDefault(); sequencer.addStep($('.select-module').val()); - sequencer.run(document.sequencer_image); // later we might only run this step, if we can fetch the image output from the previous + sequencer.run(sequencer.initial_image); // later we might only run this step, if we can fetch the image output from the previous }); diff --git a/src/ImageSequencer.js b/src/ImageSequencer.js index 88723dd9..c366a13c 100644 --- a/src/ImageSequencer.js +++ b/src/ImageSequencer.js @@ -5,6 +5,7 @@ ImageSequencer = function ImageSequencer(options) { options = options || {}; options.inBrowser = options.inBrowser || typeof window !== 'undefined'; if (options.inBrowser) options.ui = options.ui || require('./UserInterface'); + options.initial_image = ""; var image, steps = [], @@ -89,7 +90,7 @@ ImageSequencer = function ImageSequencer(options) { image.onload = function() { run(image); if (callback) callback(image); - document.sequencer_image = image; + options.initial_image = image; } image.src = src; } diff --git a/src/modules/ImageSelect.js b/src/modules/ImageSelect.js index d9a8f660..4285e882 100644 --- a/src/modules/ImageSelect.js +++ b/src/modules/ImageSelect.js @@ -42,7 +42,7 @@ module.exports = function ImageSelect(options) { image = new Image(); image.src = e.target.result; - document.sequencer_image = image; + options.initial_image = image; el.html(image); // may be redundant // this is done once per image: