Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
711b6462
Commit
711b6462
authored
Apr 03, 2020
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_document_scanner: restore cropbox data when resizing
parent
371747bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/cropper.js.js
...lateItem/portal_skins/erp5_document_scanner/cropper.js.js
+22
-0
No files found.
bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/cropper.js.js
View file @
711b6462
...
...
@@ -1795,7 +1795,29 @@
resize
:
function
resize
()
{
// Always render fully
// Otherwise, there are some display issue when increasing the window size (part of the canvas is hidden)
var
options
=
this
.
options
,
container
=
this
.
container
,
containerData
=
this
.
containerData
;
var
minContainerWidth
=
Number
(
options
.
minContainerWidth
)
||
MIN_CONTAINER_WIDTH
;
var
minContainerHeight
=
Number
(
options
.
minContainerHeight
)
||
MIN_CONTAINER_HEIGHT
;
var
ratio
=
container
.
offsetWidth
/
containerData
.
width
;
// Resize when width changed or height changed
var
canvasData
;
var
cropBoxData
;
canvasData
=
this
.
getCanvasData
();
cropBoxData
=
this
.
getCropBoxData
();
this
.
render
();
this
.
setCanvasData
(
forEach
(
canvasData
,
function
(
n
,
i
)
{
canvasData
[
i
]
=
n
*
ratio
;
}));
this
.
setCropBoxData
(
forEach
(
cropBoxData
,
function
(
n
,
i
)
{
cropBoxData
[
i
]
=
n
*
ratio
;
}));
},
dblclick
:
function
dblclick
()
{
if
(
this
.
disabled
||
this
.
options
.
dragMode
===
DRAG_MODE_NONE
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment