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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alecs_myu
erp5
Commits
66fd4670
Commit
66fd4670
authored
Oct 06, 2017
by
Tomáš Peterka
Committed by
Tomáš Peterka
Oct 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[renderjs_ui] MultiListField does not crash when only one item is selected
/reviewed-on
nexedi/erp5!448
parent
f5d76b28
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_multilistfield_js.js
...Item/web_page_module/rjs_gadget_erp5_multilistfield_js.js
+10
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_multilistfield_js.xml
...tem/web_page_module/rjs_gadget_erp5_multilistfield_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_multilistfield_js.js
View file @
66fd4670
...
...
@@ -3,6 +3,13 @@
(
function
(
window
,
rJS
,
document
,
RSVP
)
{
'
use strict
'
;
/* Make sure that returned object is an Array instance. */
function
ensureArray
(
obj
)
{
if
(
!
obj
)
{
return
[];
}
if
(
Array
.
isArray
(
obj
))
{
return
obj
;
}
return
[
obj
];
}
function
appendListField
(
gadget
,
value
,
item_list
)
{
var
div
=
document
.
createElement
(
'
div
'
);
gadget
.
element
.
appendChild
(
div
);
...
...
@@ -32,8 +39,9 @@
var
field_json
=
options
.
field_json
||
{},
item_list
=
field_json
.
items
,
state_dict
=
{
value_list
:
JSON
.
stringify
(
field_json
.
value
||
field_json
.
default
||
[]),
value_list
:
JSON
.
stringify
(
ensureArray
(
field_json
.
value
||
field_json
.
default
)
),
editable
:
field_json
.
editable
,
required
:
field_json
.
required
,
name
:
field_json
.
key
,
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_multilistfield_js.xml
View file @
66fd4670
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
55.51162.4768.3512
3
</string>
</value>
<value>
<string>
9
62.38785.31645.1848
3
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
1
482843497.0
5
</float>
<float>
1
507301921.4
5
</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