diff --git a/frappe/public/js/frappe/ui/capture.js b/frappe/public/js/frappe/ui/capture.js index 1b1d2ff2f0..184d7b10d1 100644 --- a/frappe/public/js/frappe/ui/capture.js +++ b/frappe/public/js/frappe/ui/capture.js @@ -1,94 +1,94 @@ frappe.ui.Capture = class { - constructor (options = { }) - { - this.options = Object.assign({}, frappe.ui.Capture.DEFAULT_OPTIONS, options); - this.dialog = new frappe.ui.Dialog(); - this.template = - ` -
-
-
-
-
+ constructor (options = { }) + { + this.options = Object.assign({}, frappe.ui.Capture.DEFAULT_OPTIONS, options); + this.dialog = new frappe.ui.Dialog(); + this.template = + ` +
+
+
+
+
-
-
-
- - - -
-
- - -
-
-
- `; - $(this.dialog.body).append(this.template); +
+
+
+ + + +
+
+ + +
+
+
+ `; + $(this.dialog.body).append(this.template); - this.$btnBarSnap = $(this.dialog.body).find('#frappe-capture-btn-toolbar-snap'); - this.$btnBarKnap = $(this.dialog.body).find('#frappe-capture-btn-toolbar-knap'); - this.$btnBarKnap.hide(); + this.$btnBarSnap = $(this.dialog.body).find('#frappe-capture-btn-toolbar-snap'); + this.$btnBarKnap = $(this.dialog.body).find('#frappe-capture-btn-toolbar-knap'); + this.$btnBarKnap.hide(); - Webcam.set(this.options); - } + Webcam.set(this.options); + } - open ( ) - { - this.dialog.show(); + open ( ) + { + this.dialog.show(); - Webcam.attach('#frappe-capture'); - } + Webcam.attach('#frappe-capture'); + } - freeze ( ) - { - this.$btnBarSnap.hide(); - this.$btnBarKnap.show(); - - Webcam.freeze(); - } + freeze ( ) + { + this.$btnBarSnap.hide(); + this.$btnBarKnap.show(); + + Webcam.freeze(); + } - unfreeze ( ) - { - this.$btnBarSnap.show(); - this.$btnBarKnap.hide(); + unfreeze ( ) + { + this.$btnBarSnap.show(); + this.$btnBarKnap.hide(); - Webcam.unfreeze(); - } + Webcam.unfreeze(); + } - click (callback) - { - $(this.dialog.body).find('#frappe-capture-btn-snap').click(() => { - this.freeze(); + click (callback) + { + $(this.dialog.body).find('#frappe-capture-btn-snap').click(() => { + this.freeze(); - $(this.dialog.body).find('#frappe-capture-btn-discard').click(() => { - this.unfreeze(); - }); + $(this.dialog.body).find('#frappe-capture-btn-discard').click(() => { + this.unfreeze(); + }); - $(this.dialog.body).find('#frappe-capture-btn-accept').click(() => { - Webcam.snap((data) => { - callback(data); - }); + $(this.dialog.body).find('#frappe-capture-btn-accept').click(() => { + Webcam.snap((data) => { + callback(data); + }); - this.hide(); - }); - }); - } + this.hide(); + }); + }); + } - hide ( ) - { - Webcam.reset(); + hide ( ) + { + Webcam.reset(); - $(this.dialog.$wrapper).remove(); - } + $(this.dialog.$wrapper).remove(); + } }; frappe.ui.Capture.DEFAULT_OPTIONS = { - width: 480, height: 320, flip_horiz: true + width: 480, height: 320, flip_horiz: true } \ No newline at end of file