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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Rafael Monnerat
erp5
Commits
e70ca940
Commit
e70ca940
authored
Sep 27, 2019
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Do not crash if no option is selected
parent
486c5025
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_select_js.js
...emplateItem/web_page_module/rjs_gadget_html5_select_js.js
+12
-8
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_select_js.xml
...mplateItem/web_page_module/rjs_gadget_html5_select_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_select_js.js
View file @
e70ca940
...
@@ -99,16 +99,20 @@
...
@@ -99,16 +99,20 @@
.
declareMethod
(
'
getContent
'
,
function
getContent
()
{
.
declareMethod
(
'
getContent
'
,
function
getContent
()
{
var
result
=
{},
var
result
=
{},
select
=
this
.
element
.
querySelector
(
'
select
'
);
select
=
this
.
element
.
querySelector
(
'
select
'
),
selected_option
;
if
(
this
.
state
.
editable
)
{
if
(
this
.
state
.
editable
)
{
selected_option
=
select
.
options
[
select
.
selectedIndex
];
if
(
selected_option
!==
undefined
)
{
result
[
select
.
getAttribute
(
'
name
'
)]
=
result
[
select
.
getAttribute
(
'
name
'
)]
=
select
.
options
[
select
.
selectedIndex
]
.
value
;
selected_option
.
value
;
// Change the value state in place
// Change the value state in place
// This will prevent the gadget to be changed if
// This will prevent the gadget to be changed if
// its parent call render with the same value
// its parent call render with the same value
// (as ERP5 does in case of formulator error)
// (as ERP5 does in case of formulator error)
this
.
state
.
value
=
result
[
select
.
getAttribute
(
'
name
'
)];
this
.
state
.
value
=
result
[
select
.
getAttribute
(
'
name
'
)];
}
}
}
return
result
;
return
result
;
})
})
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_select_js.xml
View file @
e70ca940
...
@@ -228,7 +228,7 @@
...
@@ -228,7 +228,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
97
7.38881.34981.23125
</string>
</value>
<value>
<string>
97
8.42847.9438.64699
</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>
1569
336908.59
</float>
<float>
1569
589427.71
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</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