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
Jérome Perrin
rjs_json_form
Commits
8fa21733
Commit
8fa21733
authored
Jul 27, 2018
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix render_textarea support view objects if schema changed
parent
83a457e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
jsonform/gadget_json_generated_form_child.js
jsonform/gadget_json_generated_form_child.js
+7
-7
No files found.
jsonform/gadget_json_generated_form_child.js
View file @
8fa21733
...
@@ -101,13 +101,13 @@
...
@@ -101,13 +101,13 @@
return
input
;
return
input
;
}
}
function
render_textarea
(
json_
field
,
default_value
,
data_format
)
{
function
render_textarea
(
json_
document
,
data_format
)
{
var
input
=
document
.
createElement
(
"
textarea
"
);
var
input
=
document
.
createElement
(
"
textarea
"
);
if
(
default_value
!==
undefined
)
{
if
(
json_document
!==
undefined
)
{
if
(
default_value
instanceof
Array
)
{
if
(
typeof
json_document
===
"
object
"
)
{
input
.
value
=
default_value
.
join
(
"
\n
"
);
input
.
value
=
JSON
.
stringify
(
json_document
,
null
,
2
);
}
else
{
}
else
{
input
.
value
=
default_value
;
input
.
value
=
json_document
;
}
}
}
}
input
[
"
data-format
"
]
=
data_format
;
input
[
"
data-format
"
]
=
data_format
;
...
@@ -674,11 +674,11 @@
...
@@ -674,11 +674,11 @@
if
(
!
input
&&
[
"
string
"
,
"
integer
"
,
"
number
"
].
indexOf
(
type
)
>=
0
)
{
if
(
!
input
&&
[
"
string
"
,
"
integer
"
,
"
number
"
].
indexOf
(
type
)
>=
0
)
{
if
(
json_field
.
contentMediaType
===
"
text/plain
"
)
{
if
(
json_field
.
contentMediaType
===
"
text/plain
"
)
{
input
=
render_textarea
(
json_field
,
default_value
,
"
string
"
);
input
=
render_textarea
(
default_value
,
"
string
"
);
}
else
{
}
else
{
input
=
document
.
createElement
(
"
input
"
);
input
=
document
.
createElement
(
"
input
"
);
if
(
default_value
!==
undefined
)
{
if
(
default_value
!==
undefined
)
{
if
(
[
"
object
"
,
"
array
"
].
indexOf
(
getDocumentType
(
default_value
))
>=
0
)
{
if
(
typeof
default_value
===
"
object
"
)
{
default_value
=
JSON
.
stringify
(
default_value
);
default_value
=
JSON
.
stringify
(
default_value
);
}
}
input
.
value
=
default_value
;
input
.
value
=
default_value
;
...
...
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