Commit c29ff42a authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_document_scanner: Improve code to display a better Cropper area

parent ca79f11b
...@@ -33,6 +33,10 @@ div[data-gadget-url$="gadget_document_scanner.html"] .edit-picture { ...@@ -33,6 +33,10 @@ div[data-gadget-url$="gadget_document_scanner.html"] .edit-picture {
text-align: center; text-align: center;
} }
div[data-gadget-url$="gadget_document_scanner.html"] .edit-picture {
padding-top: 0.5em;
}
div[data-gadget-url$="gadget_document_scanner.html"] .camera, div[data-gadget-url$="gadget_document_scanner.html"] .camera,
div[data-gadget-url$="gadget_document_scanner.html"] .camera-input { div[data-gadget-url$="gadget_document_scanner.html"] .camera-input {
display: inline-block; display: inline-block;
...@@ -67,7 +71,13 @@ div[data-gadget-url$="gadget_document_scanner.html"] > .camera > .thumbnail-list ...@@ -67,7 +71,13 @@ div[data-gadget-url$="gadget_document_scanner.html"] > .camera > .thumbnail-list
} }
div[data-gadget-url$="gadget_document_scanner.html"] .show-img { div[data-gadget-url$="gadget_document_scanner.html"] .show-img {
width: 21%; padding-left: 0.2em;
}
div[data-gadget-url$="gadget_document_scanner.html"] .thumbnail-list > button {
max-width: 25%;
display: inline;
float: left;
} }
div[data-gadget-url$="gadget_document_scanner.html"] .upload-error { div[data-gadget-url$="gadget_document_scanner.html"] .upload-error {
......
...@@ -244,7 +244,7 @@ ...@@ -244,7 +244,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>981.42527.16024.21179</string> </value> <value> <string>981.53994.46343.31095</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -262,7 +262,7 @@ ...@@ -262,7 +262,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1575027025.78</float> <float>1581629502.14</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
// creating Cropper is asynchronous // creating Cropper is asynchronous
return new RSVP.Promise(function (resolve, reject) { return new RSVP.Promise(function (resolve, reject) {
cropper = new Cropper(element, { cropper = new Cropper(element, {
viewMode: 3,
data: data, data: data,
ready: function () { ready: function () {
return new RSVP.Queue() return new RSVP.Queue()
...@@ -514,7 +515,7 @@ ...@@ -514,7 +515,7 @@
throw new Error('Unhandled display step: ' + gadget.state.display_step); throw new Error('Unhandled display step: ' + gadget.state.display_step);
} }
// Only refresh the thumbnail list // Only refresh the thumbnail area
// if display_step is not modified // if display_step is not modified
return buildPreviousThumbnailDom(gadget) return buildPreviousThumbnailDom(gadget)
.push(function (result) { .push(function (result) {
...@@ -574,7 +575,7 @@ ...@@ -574,7 +575,7 @@
.push(function () { .push(function () {
var canvas = gadget.cropper.getCroppedCanvas(); var canvas = gadget.cropper.getCroppedCanvas();
return new Promise(function (resolve) { return new Promise(function (resolve) {
canvas.toBlob(resolve, 'image/jpeg', 0.85); canvas.toBlob(resolve);
}); });
}) })
.push(function (blob) { .push(function (blob) {
......
...@@ -244,7 +244,7 @@ ...@@ -244,7 +244,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>981.53435.24231.47104</string> </value> <value> <string>981.54005.25628.18841</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -262,7 +262,7 @@ ...@@ -262,7 +262,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1581596045.41</float> <float>1581630274.1</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
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