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
358c35c2
Commit
358c35c2
authored
Mar 16, 2019
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rerender() return array changed paths
parent
d3801001
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
18 deletions
+25
-18
jsonform.gadget.js
jsonform.gadget.js
+5
-2
jsonform/gadget_json_generated_form_child.js
jsonform/gadget_json_generated_form_child.js
+20
-16
No files found.
jsonform.gadget.js
View file @
358c35c2
...
...
@@ -981,7 +981,7 @@
return
g
.
printErrors
();
})
.
push
(
function
()
{
if
(
g
.
props
.
form_gadget
.
props
.
changed
)
{
if
(
g
.
props
.
form_gadget
.
props
.
changed
.
length
>
0
)
{
g
.
notifyChange
();
}
})
...
...
@@ -1028,10 +1028,13 @@
ignore_incorrect
:
opt
.
ignore_incorrect
})
.
push
(
function
()
{
if
(
gadget
.
props
.
changed
)
{
if
(
gadget
.
props
.
changed
.
length
>
0
)
{
value
=
undefined
;
}
return
gadget
.
reValidate
(
value
,
opt
.
schema
);
})
.
push
(
function
()
{
return
gadget
.
props
.
changed
;
});
});
})
...
...
jsonform/gadget_json_generated_form_child.js
View file @
358c35c2
...
...
@@ -158,7 +158,7 @@
if
(
json_document
!==
undefined
&&
!
selected
)
{
if
(
g
.
props
.
ignore_incorrect
)
{
empty_option
.
selected
=
true
;
g
.
props
.
changed
=
true
;
g
.
props
.
changed
.
push
(
input
)
;
}
else
{
// save original json_document even if it
// not support with schema
...
...
@@ -216,7 +216,7 @@
if
(
json_document
!==
undefined
&&
!
selected
)
{
if
(
g
.
props
.
ignore_incorrect
)
{
empty_option
.
selected
=
true
;
g
.
props
.
changed
=
true
;
g
.
props
.
changed
.
push
(
input
)
;
}
else
{
// save original json_document even if it
// not support with schema
...
...
@@ -261,11 +261,8 @@
input
.
setAttribute
(
'
readonly
'
,
true
);
if
(
json_document
===
undefined
||
g
.
props
.
ignore_incorrect
||
deepEqual
(
json_document
,
schema
.
const
))
{
if
(
json_document
===
undefined
)
{
g
.
props
.
changed
=
true
;
}
if
(
!
deepEqual
(
json_document
,
schema
.
const
))
{
g
.
props
.
changed
=
true
;
if
(
json_document
===
undefined
||
!
deepEqual
(
json_document
,
schema
.
const
))
{
g
.
props
.
changed
.
push
(
input
);
}
input
.
setAttribute
(
'
data-origin-value
'
,
ser_const
);
if
(
schema
.
title
)
{
...
...
@@ -362,8 +359,9 @@
}
})
.
push
(
function
()
{
if
(
form_gadget
.
props
.
changed
)
{
g
.
props
.
changed
=
true
;
if
(
form_gadget
.
props
.
changed
.
length
>
0
)
{
// XXX not exactly path changed element
g
.
props
.
changed
.
push
(
parent_path
);
}
return
form_gadget
.
element
;
});
...
...
@@ -1005,7 +1003,7 @@
const
:
json_document
};
}
else
{
gadget
.
props
.
changed
=
true
;
gadget
.
props
.
changed
.
push
(
first_path
)
;
}
}
if
(
type
===
undefined
&&
json_document
!==
undefined
)
{
...
...
@@ -1587,15 +1585,15 @@
return
queue
;
})
.
push
(
function
()
{
if
(
g
.
props
.
ignore_incorrect
)
{
g
.
props
.
changed
=
true
;
return
;
}
var
key
,
queue
=
RSVP
.
Queue
();
for
(
key
in
json_document
)
{
if
(
json_document
.
hasOwnProperty
(
key
))
{
if
(
!
used_properties
.
hasOwnProperty
(
key
))
{
if
(
g
.
props
.
ignore_incorrect
)
{
g
.
props
.
changed
.
push
(
path
);
return
;
}
queue
.
push
(
addSubForm
.
bind
(
g
,
{
...
...
@@ -2110,7 +2108,7 @@
if
(
opt
.
ignore_incorrect
!==
undefined
)
{
g
.
props
.
ignore_incorrect
=
opt
.
ignore_incorrect
;
}
g
.
props
.
changed
=
false
;
g
.
props
.
changed
=
[]
;
g
.
props
.
inputs
=
[];
g
.
props
.
add_buttons
=
[];
g
.
props
.
add_custom_data
=
{};
...
...
@@ -2136,9 +2134,15 @@
for
(
i
=
0
;
i
<
for_delete
.
length
;
i
+=
1
)
{
root
.
removeChild
(
for_delete
[
i
]);
}
if
(
g
.
props
.
changed
)
{
if
(
g
.
props
.
changed
.
length
>
0
)
{
value
=
undefined
;
}
g
.
props
.
changed
=
g
.
props
.
changed
.
map
(
function
(
el
)
{
if
(
el
.
name
)
{
return
el
.
name
;
}
return
el
;
});
return
g
.
checkValidity
(
value
);
})
.
push
(
function
()
{
...
...
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