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
3cd406b7
Commit
3cd406b7
authored
Mar 14, 2019
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add getSubGadget()
parent
c53ac880
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
jsonform.gadget.js
jsonform.gadget.js
+28
-0
No files found.
jsonform.gadget.js
View file @
3cd406b7
...
@@ -706,6 +706,31 @@
...
@@ -706,6 +706,31 @@
this
.
props
.
errors
[
arr
[
1
]]
=
arr
[
0
];
this
.
props
.
errors
[
arr
[
1
]]
=
arr
[
0
];
}
}
})
})
.
declareMethod
(
'
getSubGadget
'
,
function
(
scope
)
{
// recursive getDeclaredGadget
// work only if subgadget scope contain parent
// scope as prefix
// example:
// gadget: scope1234
// subgadet: scope1234_subgadgetscope1
// subsubgadet: scope1234_subgadgetscope1_subsubgadetscope
var
i
,
gadget
=
this
,
scope_arr
=
scope
.
split
(
'
_
'
),
queue
=
RSVP
.
Queue
()
.
push
(
function
()
{
return
gadget
.
props
.
form_gadget
;
});
function
getDeclaredGadget
(
scope
)
{
return
function
(
g
)
{
return
g
.
getDeclaredGadget
(
scope
);
};
}
for
(
i
=
2
;
i
<=
scope_arr
.
length
;
i
+=
1
)
{
queue
.
push
(
getDeclaredGadget
(
scope_arr
.
slice
(
0
,
i
).
join
(
'
_
'
)));
}
return
queue
;
})
.
declareMethod
(
'
getGadgetByPath
'
,
function
(
path
)
{
.
declareMethod
(
'
getGadgetByPath
'
,
function
(
path
)
{
return
this
.
props
.
form_gadget
.
getGadgetByPath
(
path
||
"
/
"
);
return
this
.
props
.
form_gadget
.
getGadgetByPath
(
path
||
"
/
"
);
})
})
...
@@ -961,6 +986,9 @@
...
@@ -961,6 +986,9 @@
})
})
.
push
(
function
()
{
.
push
(
function
()
{
return
g
;
return
g
;
})
.
push
(
undefined
,
function
(
err
)
{
console
.
error
(
err
);
});
});
})
})
.
declareMethod
(
'
rerender
'
,
function
(
opt
)
{
.
declareMethod
(
'
rerender
'
,
function
(
opt
)
{
...
...
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