mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-14 12:19:58 +01:00
Allow Options in replaceImage
This commit is contained in:
@@ -131,7 +131,8 @@ ImageSequencer = function ImageSequencer(options) {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
function replaceImage(selector,steps) {
|
function replaceImage(selector,steps,options) {
|
||||||
|
options = options || {};
|
||||||
require('./ReplaceImage')(this,selector,steps);
|
require('./ReplaceImage')(this,selector,steps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
function ReplaceImage(ref,selector,steps) {
|
function ReplaceImage(ref,selector,steps,options) {
|
||||||
if(!ref.options.inBrowser) return; // This isn't for Node.js
|
if(!ref.options.inBrowser) return; // This isn't for Node.js
|
||||||
this_ = ref;
|
this_ = ref;
|
||||||
var input = document.querySelectorAll(selector);
|
var input = document.querySelectorAll(selector);
|
||||||
@@ -25,7 +25,7 @@ function ReplaceImage(ref,selector,steps) {
|
|||||||
else make(url);
|
else make(url);
|
||||||
|
|
||||||
function make(url) {
|
function make(url) {
|
||||||
this_.loadImage(url).addSteps('default',steps).run(function(out){
|
this_.loadImage('default',url).addSteps('default',steps,options).run(function(out){
|
||||||
the_image.src = out;
|
the_image.src = out;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user