Commit b2643ca3 authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_document_scanner: use onEvent instead of addEventListener

parent 6f7772db
...@@ -173,9 +173,18 @@ ...@@ -173,9 +173,18 @@
selector.appendChild(el); selector.appendChild(el);
} }
} }
});
}) })
.push(function () { .declareMethod('getContent', function () {
selector.addEventListener("change", function (evt) { var input = this.element.querySelector('.photoInput'),
result = {};
result.field_your_document_scanner_gadget = input.value;
return result;
})
.onEvent("change", function (evt) {
if (evt.target.type == "select-one") {
return this.getElement()
.push(function (root) {
if (video) { if (video) {
video.pause(); video.pause();
} }
...@@ -183,15 +192,9 @@ ...@@ -183,15 +192,9 @@
return startup(root, evt.target.value); return startup(root, evt.target.value);
} }
}); });
}); }
}, false, true)
})
.declareMethod('getContent', function () {
var input = this.element.querySelector('.photoInput'),
result = {};
result.field_your_document_scanner_gadget = input.value;
return result;
})
.onEvent("click", function (evt) { .onEvent("click", function (evt) {
var canvasData; var canvasData;
if (evt.target.className == "startbutton") { if (evt.target.className == "startbutton") {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment