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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tristan Cavelier
erp5
Commits
4e083e84
Commit
4e083e84
authored
Jun 17, 2019
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "DATETIMEFIELDUPDATE cleanup code"
This reverts commit
5c79470a
.
parent
eabe52e1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
17 deletions
+32
-17
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_form_js.js
...plateItem/web_page_module/rjs_gadget_erp5_page_form_js.js
+5
-7
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_input_js.js
...TemplateItem/web_page_module/rjs_gadget_html5_input_js.js
+25
-8
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_input_js.xml
...emplateItem/web_page_module/rjs_gadget_html5_input_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_form_js.js
View file @
4e083e84
...
...
@@ -97,10 +97,8 @@ and handling data send&receive.
content_key_list
=
Object
.
keys
(
current_content
),
document_reference_dict
=
{},
document_key_list
=
Object
.
keys
(
view
),
i
=
0
,
field
=
null
,
key
=
""
;
for
(
i
=
0
;
i
<
document_key_list
.
length
;
i
+=
1
)
{
i
=
0
,
field
=
null
,
key
=
""
;
for
(;
i
<
document_key_list
.
length
;
i
+=
1
)
{
field
=
view
[
document_key_list
[
i
]];
document_reference_dict
[
field
.
key
]
=
field
;
}
...
...
@@ -312,7 +310,7 @@ and handling data send&receive.
page_template_gadget
=
result
;
var
sub_options
=
options
.
fg
||
{},
sub_
queue
=
null
;
queue
=
null
;
loadFormContent
(
gadget
,
erp5_document
.
_embedded
.
_view
);
...
...
@@ -324,7 +322,7 @@ and handling data send&receive.
sub_options
.
editable
=
options
.
editable
;
// form decides on editability of its fields
if
(
gadget
.
state
.
changing
&&
gadget
.
state
.
last_submitted_content
)
{
sub_
queue
=
page_template_gadget
.
getContent
()
queue
=
page_template_gadget
.
getContent
()
.
push
(
function
(
content
)
{
updateErp5DocumentForAfterSave
(
sub_options
.
erp5_document
,
...
...
@@ -336,7 +334,7 @@ and handling data send&receive.
});
}
return
(
sub_
queue
||
new
RSVP
.
Queue
())
return
(
queue
||
new
RSVP
.
Queue
())
.
push
(
function
()
{
return
page_template_gadget
.
render
(
sub_options
);
});
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_input_js.js
View file @
4e083e84
...
...
@@ -19,6 +19,7 @@
rJS
(
window
)
.
declareMethod
(
'
render
'
,
function
render
(
options
)
{
//if (this.state && this.state.name === "field_my_short_title" || options && options.name === "field_my_short_title") console.log("input: render on call", options);
return
this
.
changeState
({
value
:
getFirstNonEmpty
(
options
.
value
,
""
),
checked
:
options
.
checked
,
...
...
@@ -41,18 +42,32 @@
})
.
onStateChange
(
function
onStateChange
(
modification_dict
)
{
//if (this.state.name === "field_my_short_title") console.log("input: onStateChange on call", modification_dict);
var
textarea
=
this
.
element
.
querySelector
(
'
input
'
),
tmp
;
// general use short-scope variable
if
(
this
.
state
.
type
===
'
checkbox
'
)
{
textarea
.
checked
=
this
.
state
.
checked
;
}
else
{
textarea
.
setAttribute
(
'
value
'
,
this
.
state
.
value
);
/*if (modification_dict.hasOwnProperty("value")) { // TRISTAN
textarea.value = this.state.value;
textarea.setAttribute('value', this.state.value);
}
if
(
this
.
state
.
type
===
'
radio
'
)
{
if (
modification_dict.hasOwnProperty("checked")) { // TRISTAN
textarea.checked = this.state.checked;
if (this.state.checked) {
textarea.setAttribute('checked', 'checked');
} else {
textarea.removeAttribute('checked');
}
}/**/
if
(
this
.
state
.
type
===
'
checkbox
'
)
{
textarea
.
checked
=
this
.
state
.
checked
;
// TRISTAN
}
else
{
textarea
.
setAttribute
(
'
value
'
,
this
.
state
.
value
);
// TRISTAN
textarea
.
value
=
this
.
state
.
value
;
// TRISTAN
}
if
(
this
.
state
.
type
===
'
radio
'
)
{
textarea
.
checked
=
this
.
state
.
checked
;
// TRISTAN
}
/**/
textarea
.
id
=
this
.
state
.
id
||
this
.
state
.
name
;
textarea
.
setAttribute
(
'
name
'
,
this
.
state
.
name
);
...
...
@@ -206,13 +221,15 @@
},
{
mutex
:
'
changestate
'
})
.
declareAcquiredMethod
(
"
notifyChange
"
,
"
notifyChange
"
)
.
onEvent
(
'
change
'
,
function
change
()
{
var
input
=
this
.
element
.
querySelector
(
"
input
"
);
//.onEvent('change', function change() {
.
onEvent
(
'
change
'
,
function
change
(
event
)
{
//if (this.state.name === "field_my_short_title") console.log("input: event change", event, event.target.value);
var
input
=
this
.
element
.
querySelector
(
"
input
"
);
// TRISTAN
if
(
input
)
{
// force the state to have the current edited value
this
.
state
.
checked
=
input
.
checked
;
this
.
state
.
value
=
input
.
value
;
}
}
/**/
return
RSVP
.
all
([
this
.
checkValidity
(),
this
.
notifyChange
(
"
change
"
)
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_input_js.xml
View file @
4e083e84
...
...
@@ -228,7 +228,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
975.
45053.32644.40618
</string>
</value>
<value>
<string>
975.
39254.10526.36096
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -246,7 +246,7 @@
</tuple>
<state>
<tuple>
<float>
1557
839422.8
</float>
<float>
1557
412896.19
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
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