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
5bd4e92f
Commit
5bd4e92f
authored
Apr 30, 2019
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix path and rel_path computation in notifyChange
parent
350a179d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
20 deletions
+28
-20
jsonform/gadget_json_generated_form_child.js
jsonform/gadget_json_generated_form_child.js
+28
-20
No files found.
jsonform/gadget_json_generated_form_child.js
View file @
5bd4e92f
/*jslint nomen: true, maxlen: 200, indent: 2, maxerr: 100*/
/*global window, document, URL, rJS, RSVP, jIO, tv4, location */
/*global window, document, URL, rJS, RSVP, jIO, tv4, location
, console
*/
(
function
(
window
,
document
,
location
,
rJS
,
RSVP
,
tv4
)
{
"
use strict
"
;
...
...
@@ -773,20 +773,6 @@
});
}
function
get_scope_path_from_element
(
gadget
,
element
)
{
var
scope
=
element
.
getAttribute
(
"
data-gadget-scope
"
);
return
gadget
.
getDeclaredGadget
(
scope
)
.
push
(
function
(
g
)
{
return
g
.
getJsonPath
();
})
.
push
(
function
(
path
)
{
return
{
scope
:
scope
,
path
:
path
};
});
}
function
render_array
(
gadget
,
schema
,
json_document
,
div_input
,
path
,
schema_path
)
{
var
input
,
array_path
,
...
...
@@ -826,7 +812,10 @@
if
(
child
)
{
input
.
parentNode
.
insertBefore
(
child
,
input
);
div_input
.
removeAttribute
(
"
data-json-empty-array
"
);
return
get_scope_path_from_element
(
gadget
,
child
);
return
{
scope
:
child
.
getAttribute
(
"
data-gadget-scope
"
),
path
:
"
/
"
};
}
}
...
...
@@ -1426,7 +1415,10 @@
if
(
child
)
{
// insert additionalProperty before selector
selector
.
element
.
parentNode
.
insertBefore
(
child
,
selector
.
element
);
return
get_scope_path_from_element
(
g
,
child
);
return
{
scope
:
child
.
getAttribute
(
"
data-gadget-scope
"
),
path
:
"
/
"
};
}
}
...
...
@@ -1834,12 +1826,28 @@
})
.
declareAcquiredMethod
(
"
rNotifyChange
"
,
"
rootNotifyChange
"
)
.
declareMethod
(
"
rootNotifyChange
"
,
function
(
v
)
{
var
g
=
this
;
var
g
=
this
,
queue
,
cur_scope
=
g
.
element
.
getAttribute
(
"
data-gadget-scope
"
);
this
.
props
.
needValidate
=
true
;
return
g
.
getJsonPath
(
v
.
path
)
if
(
v
.
scope
&&
v
.
scope
!==
cur_scope
)
{
queue
=
g
.
getDeclaredGadget
(
v
.
scope
);
}
else
{
queue
=
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
g
;
});
}
if
(
!
v
.
scope
)
{
v
.
scope
=
cur_scope
;
}
return
queue
.
push
(
function
(
gadget
)
{
return
gadget
.
getJsonPath
(
v
.
path
);
})
.
push
(
function
(
p
)
{
return
g
.
rNotifyChange
({
scope
:
v
.
scope
||
g
.
element
.
getAttribute
(
"
data-gadget-scope
"
)
,
scope
:
v
.
scope
,
rel_path
:
v
.
path
,
path
:
p
,
ref
:
g
.
props
.
schema_arr
.
external_reference
,
...
...
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