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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cédric Le Ninivin
erp5
Commits
0d8d8ee7
Commit
0d8d8ee7
authored
Oct 31, 2019
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_production_planning: possible to copy
parent
362dd21c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
7 deletions
+85
-7
bt5/erp5_production_planning/SkinTemplateItem/portal_skins/erp5_production_planning/production_planning.css.css
...kins/erp5_production_planning/production_planning.css.css
+4
-0
bt5/erp5_production_planning/SkinTemplateItem/portal_skins/erp5_production_planning/production_planning.js.js
..._skins/erp5_production_planning/production_planning.js.js
+81
-7
No files found.
bt5/erp5_production_planning/SkinTemplateItem/portal_skins/erp5_production_planning/production_planning.css.css
View file @
0d8d8ee7
...
...
@@ -31,3 +31,7 @@
.content
.field
.change
{
color
:
#f40
;
}
.matrixbox_production_planning
table
tbody
td
span
:last-child
input
.select
{
background-color
:
#E3EAFA
;
}
\ No newline at end of file
bt5/erp5_production_planning/SkinTemplateItem/portal_skins/erp5_production_planning/production_planning.js.js
View file @
0d8d8ee7
...
...
@@ -88,8 +88,7 @@ function addTotalColumnToMatrixBox() {
function
addTotalLineColumnToMatrixBox
(
matrixbox_container
)
{
matrixbox
=
$
(
matrixbox_container
.
querySelector
(
'
.MatrixContent
'
));
function
addTotalLineColumnToMatrixBox
()
{
addTotalLineToMatrixBox
();
//addTotalColumnToMatrixBox();
//matrixbox.find('.MatrixBoxSumColumn').each(recalculateSumColumn);
...
...
@@ -124,7 +123,6 @@ function listenToInputChange(matrixbox_container) {
function
listenToInputPaste
(
matrixbox_container
)
{
matrixbox
=
$
(
matrixbox_container
.
querySelector
(
'
.MatrixContent
'
));
$
(
'
div.matrixbox_production_planning td input
'
).
bind
(
'
paste
'
,
null
,
function
(
e
)
{
var
i
,
j
,
input
,
...
...
@@ -149,6 +147,80 @@ function listenToInputPaste(matrixbox_container) {
}
function
listenToInputCopy
(
matrixbox_container
)
{
var
initial_td_index
=
undefined
,
initial_tr_index
,
tmp_td
,
tmp_tr
,
tr
,
td
,
current_td_index
,
current_tr_index
;
matrixbox
.
bind
(
'
copy
'
,
null
,
function
(
e
)
{
var
copy_data
=
""
,
separator
,
line
;
e
.
preventDefault
();
e
.
stopPropagation
();
matrixbox
.
find
(
'
tr td input.select
'
).
each
(
function
(
index
,
element
)
{
index
=
$
(
element
.
parentElement
.
parentElement
.
parentElement
).
index
();
separator
=
'
'
;
line
=
line
||
index
;
if
(
line
&&
line
!=
index
)
{
separator
=
'
\n
'
;
line
=
index
;
}
if
(
copy_data
)
{
copy_data
=
copy_data
+
separator
+
element
.
value
;
}
else
{
copy_data
=
element
.
value
;
}
});
e
.
originalEvent
.
clipboardData
.
setData
(
'
text/plain
'
,
copy_data
);
});
$
(
'
html
'
).
bind
(
'
mousedown
'
,
null
,
function
(
e
)
{
if
(
e
.
buttons
==
1
)
{
matrixbox
.
find
(
'
tr td input.select
'
).
removeClass
(
'
select
'
);
initial_td_index
=
undefined
;
initial_tr_index
=
undefined
;
}
});
$
(
'
div.matrixbox_production_planning td input
'
).
bind
(
'
mousedown mouseover
'
,
null
,
function
(
e
)
{
if
(
e
.
buttons
==
1
||
e
.
buttons
==
3
)
{
current_td_index
=
$
(
e
.
target
.
parentElement
.
parentElement
).
index
();
current_tr_index
=
$
(
e
.
target
.
parentElement
.
parentElement
.
parentElement
).
index
();
matrixbox
.
find
(
'
tr td input.select
'
).
removeClass
(
'
select
'
);
if
(
initial_td_index
===
undefined
)
{
initial_td_index
=
current_td_index
;
initial_tr_index
=
current_tr_index
;
e
.
stopPropagation
();
//e.preventDefault();
}
else
{
var
min_tr
=
initial_tr_index
,
max_tr
=
current_tr_index
,
min_td
=
initial_td_index
,
max_td
=
current_td_index
;
if
(
initial_tr_index
>
current_tr_index
)
{
min_tr
=
current_tr_index
;
max_tr
=
initial_tr_index
;
}
if
(
initial_td_index
>
current_td_index
)
{
min_td
=
current_td_index
;
max_td
=
initial_td_index
;
}
for
(
tmp_tr
=
min_tr
;
tmp_tr
<=
max_tr
;
tmp_tr
+=
1
)
{
tr
=
matrixbox
.
find
(
'
tr:eq(
'
+
tmp_tr
+
'
)
'
);
for
(
tmp_td
=
min_td
;
tmp_td
<=
max_td
;
tmp_td
+=
1
)
{
input
=
tr
.
find
(
'
td:eq(
'
+
tmp_td
+
'
) input
'
);
input
.
addClass
(
'
select
'
);
}
}
}
}
});
}
var
config
=
{
childList
:
true
,
...
...
@@ -166,10 +238,12 @@ function observe(mutationsList) {
if
(
node
.
nodeType
===
Node
.
ELEMENT_NODE
)
{
// Make sure matrixbox is fully displayed
if
(
node
.
getAttribute
(
'
class
'
)
==
'
Data footer
'
)
{
var
matrixbox
=
document
.
querySelector
(
'
.matrixbox_production_planning
'
);
addTotalLineColumnToMatrixBox
(
matrixbox
);
listenToInputPaste
(
matrixbox
);
listenToInputChange
(
matrixbox
);
var
matrixbox_container
=
document
.
querySelector
(
'
.matrixbox_production_planning
'
);
matrixbox
=
$
(
matrixbox_container
.
querySelector
(
'
.MatrixContent
'
));
addTotalLineColumnToMatrixBox
(
matrixbox_container
);
listenToInputPaste
(
matrixbox_container
);
listenToInputChange
(
matrixbox_container
);
listenToInputCopy
(
matrixbox_container
);
observer
.
disconnect
();
}
}
...
...
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