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