Fix Average module editing the UI from the source (#1469)

* Fix Average module editing the UI from the source

* requested changes

* Delete demo.js

* cleanup

Co-authored-by: Harsh Khandeparkar <34770591+HarshKhandeparkar@users.noreply.github.com>
Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
This commit is contained in:
Naman Aggarwal
2020-01-17 00:46:51 +05:30
committed by Jeffrey Warren
parent b0ddea012a
commit 5ae545904d
3 changed files with 13 additions and 7 deletions

View File

@@ -42,8 +42,8 @@ module.exports = function Average(options, UI) {
// report back and store average in metadata:
options.step.metadata.averages = sum;
// TODO: refactor into a new "display()" method as per https://github.com/publiclab/image-sequencer/issues/242
if (options.step.inBrowser && options.step.ui) $(options.step.ui).find('.details').append('<p><b>Averages</b> (r, g, b, a): ' + sum.join(', ') + '</p>');
if (options.step.average === undefined) options.step.average = '';
options.step.average += 'rgba(' + sum.join(', ') + ')';
return pixels;
}