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
Rafael Monnerat
rjs_json_form
Commits
f6fb8ee4
Commit
f6fb8ee4
authored
Apr 01, 2018
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix jslint
parent
1d9d6f60
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
15 deletions
+12
-15
gadget_json_generated_form.js
gadget_json_generated_form.js
+12
-15
No files found.
gadget_json_generated_form.js
View file @
f6fb8ee4
...
...
@@ -3,6 +3,7 @@
(
function
(
window
,
document
,
rJS
,
RSVP
)
{
"
use strict
"
;
var
render_object
;
function
decodeJsonPointer
(
_str
)
{
// https://tools.ietf.org/html/rfc6901#section-5
...
...
@@ -321,7 +322,7 @@
});
}
function
render_object
(
g
,
json_field
,
default_dict
,
root
,
path
)
{
render_object
=
function
(
g
,
json_field
,
default_dict
,
root
,
path
)
{
var
additionalProperties
,
key
,
required
=
json_field
.
required
||
[],
...
...
@@ -511,7 +512,7 @@
}
}
return
queue
;
}
}
;
function
getFormValuesAsJSONDict
(
g
)
{
var
multi_level_dict
=
{
""
:
{}},
...
...
@@ -656,23 +657,23 @@
})
.
declareAcquiredMethod
(
"
renameChildrenParent
"
,
"
renameChildren
"
)
.
allowPublicAcquisition
(
"
renameChildren
"
,
function
(
opt
)
{
.
allowPublicAcquisition
(
"
renameChildren
"
,
function
(
opt
_arr
,
scope
)
{
var
property_name
,
objects
=
this
.
props
.
objects
,
options
=
opt
[
0
],
// TODO strange rjs behavior
element
=
getSubGadgetElement
(
this
,
options
.
scope
),
new_name
=
opt_arr
[
0
],
element
=
getSubGadgetElement
(
this
,
scope
),
parent
=
element
.
getAttribute
(
'
data-json-parent
'
);
if
(
objects
.
hasOwnProperty
(
parent
))
{
parent
=
objects
[
parent
];
if
(
parent
.
hasOwnProperty
(
options
.
new_name
))
{
if
(
parent
.
hasOwnProperty
(
new_name
))
{
throw
new
Error
(
"
property already exist
"
);
}
// XXX validate property if property pattern
for
(
property_name
in
parent
)
{
if
(
parent
.
hasOwnProperty
(
property_name
)
&&
parent
[
property_name
]
===
options
.
scope
)
{
if
(
parent
.
hasOwnProperty
(
property_name
)
&&
parent
[
property_name
]
===
scope
)
{
delete
parent
[
property_name
];
parent
[
options
.
new_name
]
=
options
.
scope
;
return
options
.
new_name
;
parent
[
new_name
]
=
scope
;
return
new_name
;
}
}
throw
new
Error
(
"
gadget not found for renaming
"
);
...
...
@@ -681,12 +682,7 @@
.
declareMethod
(
"
rename
"
,
function
(
new_name
,
event
)
{
var
g
=
this
,
name
=
g
.
element
.
getAttribute
(
'
data-json-property-name
'
);
return
this
.
renameChildrenParent
({
scope
:
g
.
element
.
getAttribute
(
'
data-gadget-scope
'
),
// parent: g.element.getAttribute('data-json-parent'),
// name: g.element.getAttribute('data-json-property-name'),
new_name
:
new_name
})
return
this
.
renameChildrenParent
(
new_name
)
.
push
(
function
()
{
return
g
.
element
.
setAttribute
(
'
data-json-property-name
'
,
new_name
);
})
...
...
@@ -793,6 +789,7 @@
})
.
allowPublicAcquisition
(
"
notifyValid
"
,
function
(
arr
,
sub_scope
)
{
return
true
;
})
.
allowPublicAcquisition
(
"
notifyChange
"
,
function
(
arr
,
sub_scope
)
{
var
g
=
this
,
...
...
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