Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
rjs_json_form
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
rjs_json_form
Commits
b7bdafad
Commit
b7bdafad
authored
Aug 27, 2018
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
return empty array [] only after user change array
parent
848e3029
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
jsonform/gadget_json_generated_form_child.js
jsonform/gadget_json_generated_form_child.js
+8
-1
No files found.
jsonform/gadget_json_generated_form_child.js
View file @
b7bdafad
...
...
@@ -601,16 +601,22 @@
function
render_array
(
gadget
,
schema
,
json_document
,
div_input
,
path
,
schema_path
)
{
var
input
,
minItems
=
schema
.
minItems
||
0
;
if
(
schema
.
default
===
undefined
&&
json_document
===
undefined
)
{
div_input
.
setAttribute
(
"
data-undefined
"
,
"
true
"
);
}
function
element_append
(
child
)
{
if
(
child
)
{
input
.
parentNode
.
insertBefore
(
child
,
input
);
div_input
.
removeAttribute
(
"
data-undefined
"
);
}
}
function
div_append
(
child
)
{
if
(
child
)
{
div_input
.
appendChild
(
child
);
div_input
.
removeAttribute
(
"
data-undefined
"
);
}
}
...
...
@@ -1370,7 +1376,8 @@
array
=
options
.
arrays
[
path
]
.
querySelectorAll
(
"
div[data-gadget-parent-scope='
"
+
g
.
element
.
getAttribute
(
"
data-gadget-scope
"
)
+
"
']
"
);
len
=
array
.
length
;
if
(
len
===
0
)
{
if
(
len
===
0
&&
!
options
.
arrays
[
path
].
hasAttribute
(
'
data-undefined
'
))
{
convertOnMultiLevel
(
multi_level_dict
,
path
.
slice
(
0
,
-
1
),
[]);
}
for
(
i
=
0
;
i
<
len
;
i
=
i
+
1
)
{
...
...
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