Commit 043dd8fd authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_document_scanner: restrict the minimum canvas size to fill fit the container

And add comments
parent 76ae0847
...@@ -60,7 +60,13 @@ ...@@ -60,7 +60,13 @@
// 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, {
// restrict the minimum canvas size to fill fit the container
viewMode: 3, viewMode: 3,
// Avoid any cropper calculation or guessing
scalable: false,
rotatable: false,
zoomable: false,
movable: false,
data: data, data: data,
ready: function () { ready: function () {
return new RSVP.Queue() return new RSVP.Queue()
...@@ -367,7 +373,10 @@ ...@@ -367,7 +373,10 @@
domsugar('label', {'class': 'page-number', text: gadget.state.page}) domsugar('label', {'class': 'page-number', text: gadget.state.page})
]) ])
]), ]),
img, // If you don't know what you are doing:
// DON'T remove img from a div img-container.
// DON'T replace img by canvas.
domsugar("div", {"class": "img-container"}, [img]),
domsugar('div', {'class': 'edit-picture'}, [ domsugar('div', {'class': 'edit-picture'}, [
domsugar('button', {type: 'button', domsugar('button', {type: 'button',
'class': 'reset-btn ui-btn-icon-left ui-icon-times', 'class': 'reset-btn ui-btn-icon-left ui-icon-times',
......
...@@ -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.59234.29833.17954</string> </value> <value> <string>981.59284.53554.54237</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>1581944351.11</float> <float>1581947027.23</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