Commit cc5d5202 authored by Romain Courteaud's avatar Romain Courteaud

erp5_document_scanner: try to bypass cropper resize issue

but doesn't seems good :/
parent 923b360e
......@@ -100,7 +100,13 @@ div[data-gadget-url$="gadget_document_scanner.html"] .new-btn {
}
div[data-gadget-url$="gadget_document_scanner.html"] .img-container {
/* Never limit the container height here */
position: relative;
width: 100%;
max-height: 500px;
}
div[data-gadget-url$="gadget_document_scanner.html"] .img-container img {
max-width: 100%;
width: 100%;
}
div[data-gadget-url$="gadget_document_scanner.html"] .btn-thumbnail:before {
color: #000;
......
......@@ -244,7 +244,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>982.60162.8290.29303</string> </value>
<value> <string>982.61223.17950.60723</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -262,7 +262,7 @@
</tuple>
<state>
<tuple>
<float>1585815950.8</float>
<float>1585822646.11</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -191,10 +191,9 @@
guides: true,
center: true,
background: false,
minContainerWidth: 1,
minContainerHeight: 1,
minContainerWidth: 0,
minContainerHeight: 0,
responsive: true,
restore: true,
// Avoid any cropper calculation or guessing
scalable: false,
rotatable: false,
......@@ -430,11 +429,14 @@
text: result_list[1][0]
}));
button_list.push(
domsugar('button', {type: 'button',
'class': 'auto-crop-btn ui-icon-fast-forward ui-btn-icon-left',
text: result_list[1][3]
}));
if (gadget.state.is_cropper_size_confirmed) {
button_list.push(
domsugar('button', {type: 'button',
'class': 'auto-crop-btn ui-icon-fast-forward ui-btn-icon-left',
text: result_list[1][3]
})
);
}
div = domsugar('div', {'class': 'camera'}, [
domsugar('div', {'class': 'camera-header'}, [
......@@ -720,9 +722,7 @@
domsugar('label', {'class': 'page-number', text: gadget.state.page + 1})
])
]),
domsugar('div', {'class': 'img-container'}, [
domsugar('img', {src: gadget.state['blob_url_' + gadget.state.page]})
]),
domsugar('img', {src: gadget.state['blob_url_' + gadget.state.page]}),
// XXX TODO: why is the button rendering different from the other pages?
domsugar('div', {'class': 'edit-picture'}, button_list),
result_list[1]
......@@ -742,7 +742,8 @@
preferred_cropped_canvas_data: gadget.cropper.getData(),
display_step: 'display_video',
page: gadget.state.page + 1,
page_count: gadget.state.page_count + 1
page_count: gadget.state.page_count + 1,
is_cropper_size_confirmed: true
};
// Keep image date, as user may need to display it again
state_dict['blob_canvas_' + gadget.state.page_count] = canvas;
......@@ -788,7 +789,8 @@
display_step: 'display_video',
page: 1,
page_count: 0,
camera_list: []
camera_list: [],
is_cropper_size_confirmed: false
})
.declareMethod('render', function (options) {
// This method is called during the ERP5 form rendering
......
......@@ -244,7 +244,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>982.61614.28913.46660</string> </value>
<value> <string>982.61167.48996.42035</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -262,7 +262,7 @@
</tuple>
<state>
<tuple>
<float>1585846471.58</float>
<float>1585821355.34</float>
<string>UTC</string>
</tuple>
</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