@genexus/web-standard-functions
Version:
GeneXus JavaScript standard functions library for web generators
23 lines • 769 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.takePhoto = void 0;
const takePhoto = async () => {
return new Promise((resolve, reject) => {
const newInput = document.createElement("input");
newInput.type = "file";
newInput.accept = "image/*";
newInput.capture = "camera";
newInput.multiple = false;
newInput.hidden = true;
document.body.appendChild(newInput);
newInput.onchange = async (eventInfo) => {
document.body.removeChild(newInput);
resolve(newInput.files[0]);
};
requestAnimationFrame(() => {
newInput.click();
});
});
};
exports.takePhoto = takePhoto;
//# sourceMappingURL=takePhoto.js.map