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
26024012
Commit
26024012
authored
Aug 22, 2018
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change type of number field on user input so user can be view original wrong value
parent
a6bc0bae
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
jsonform/gadget_json_generated_form_child.js
jsonform/gadget_json_generated_form_child.js
+11
-4
No files found.
jsonform/gadget_json_generated_form_child.js
View file @
26024012
...
@@ -807,13 +807,14 @@
...
@@ -807,13 +807,14 @@
if
(
default_value
===
undefined
&&
typeof
json_field
.
default
===
"
number
"
)
{
if
(
default_value
===
undefined
&&
typeof
json_field
.
default
===
"
number
"
)
{
input
.
value
=
json_field
.
default
;
input
.
value
=
json_field
.
default
;
}
}
input
.
type
=
"
number
"
;
input
.
setAttribute
(
"
data-json-type
"
,
type
);
input
.
setAttribute
(
"
data-json-type
"
,
type
);
type_changed
=
default_value
!==
undefined
&&
if
(
default_value
===
undefined
||
default_value
===
null
||
typeof
default_value
!==
"
number
"
;
typeof
default_value
===
"
number
"
)
{
input
.
type
=
"
number
"
;
}
if
(
type
===
"
integer
"
)
{
if
(
type
===
"
integer
"
)
{
input
.
setAttribute
(
"
step
"
,
"
1
"
);
input
.
setAttribute
(
"
step
"
,
"
1
"
);
if
(
default_value
!==
undefined
&&
if
(
typeof
default_value
===
"
number
"
&&
parseInt
(
default_value
,
10
)
!==
default_value
)
{
parseInt
(
default_value
,
10
)
!==
default_value
)
{
// original json_document contain float schema
// original json_document contain float schema
// limit integer we can save original document
// limit integer we can save original document
...
@@ -1709,6 +1710,12 @@
...
@@ -1709,6 +1710,12 @@
if
(
input
.
hasAttribute
(
'
data-origin-value
'
))
{
if
(
input
.
hasAttribute
(
'
data-origin-value
'
))
{
input
.
removeAttribute
(
'
data-origin-value
'
);
input
.
removeAttribute
(
'
data-origin-value
'
);
}
}
if
(
!
input
.
hasAttribute
(
"
type
"
))
{
if
([
"
integer
"
,
"
number
"
]
.
indexOf
(
input
.
getAttribute
(
'
data-json-type
'
))
>=
0
)
{
input
.
type
=
"
number
"
;
}
}
changed
=
true
;
changed
=
true
;
}
}
}
}
...
...
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