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
da8c0b3d
Commit
da8c0b3d
authored
Apr 25, 2018
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rerender work for addSchemaButtons too
parent
fea39d15
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
7 deletions
+41
-7
gadget_json_generated_form.js
gadget_json_generated_form.js
+41
-7
No files found.
gadget_json_generated_form.js
View file @
da8c0b3d
...
@@ -577,18 +577,44 @@
...
@@ -577,18 +577,44 @@
if
(
schema_alternatives
.
length
===
1
)
{
if
(
schema_alternatives
.
length
===
1
)
{
return
RSVP
.
Queue
()
return
RSVP
.
Queue
()
.
push
(
function
()
{
.
push
(
function
()
{
if
(
rerender
)
{
return
rerender
(
undefined
,
schema_alternatives
);
}
return
true
;
})
.
push
(
function
(
ret
)
{
var
input
=
document
.
createElement
(
"
button
"
);
var
input
=
document
.
createElement
(
"
button
"
);
input
.
setAttribute
(
"
class
"
,
input
.
setAttribute
(
"
class
"
,
"
ui-shadow-inset ui-btn ui-btn-inline ui-corner-all
"
+
"
ui-shadow-inset ui-btn ui-btn-inline ui-corner-all
"
+
"
ui-btn-icon-notext ui-icon-btn ui-icon-plus ui-input-btn
"
);
"
ui-btn-icon-notext ui-icon-btn ui-icon-plus ui-input-btn
"
);
input
.
type
=
"
button
"
;
input
.
type
=
"
button
"
;
input
.
hidden
=
!
ret
;
gadget
.
props
.
add_buttons
.
push
({
gadget
.
props
.
add_buttons
.
push
({
element
:
input
,
element
:
input
,
event
:
function
()
{
event
:
function
()
{
return
event
(
schema_alternatives
[
0
].
value
)
return
event
(
schema_alternatives
[
0
].
value
)
.
push
(
function
()
{
.
push
(
function
()
{
if
(
rerender
)
{
return
rerender
(
undefined
,
schema_alternatives
);
}
return
true
;
})
.
push
(
function
(
r
)
{
input
.
hidden
=
!
r
;
return
checkValidityAndNotifyChange
(
gadget
);
return
checkValidityAndNotifyChange
(
gadget
);
});
});
},
rerender
:
function
()
{
return
RSVP
.
Queue
()
.
push
(
function
()
{
if
(
rerender
)
{
return
rerender
(
undefined
,
schema_alternatives
);
}
return
true
;
})
.
push
(
function
(
r
)
{
input
.
hidden
=
!
r
;
});
}
}
});
});
return
input
;
return
input
;
...
@@ -978,14 +1004,17 @@
...
@@ -978,14 +1004,17 @@
item_list
.
push
([
item
.
title
,
x
]);
item_list
.
push
([
item
.
title
,
x
]);
}
}
}
}
if
(
gadget_s
)
{
return
{
return
{
name
:
gadget_s
.
element
.
getAttribute
(
'
data-gadget-scope
'
),
name
:
gadget_s
.
element
.
getAttribute
(
'
data-gadget-scope
'
),
editable
:
true
,
editable
:
true
,
hidden
:
item_list
.
length
===
0
,
hidden
:
item_list
.
length
===
1
,
value
:
item_list
[
0
][
1
],
value
:
item_list
[
0
][
1
],
item_list
:
item_list
item_list
:
item_list
};
};
}
}
return
item_list
.
length
>
1
;
}
});
});
})
})
.
push
(
function
(
element
)
{
.
push
(
function
(
element
)
{
...
@@ -1235,6 +1264,8 @@
...
@@ -1235,6 +1264,8 @@
.
allowPublicAcquisition
(
"
deleteChildren
"
,
function
(
arr
,
scope
)
{
.
allowPublicAcquisition
(
"
deleteChildren
"
,
function
(
arr
,
scope
)
{
var
g
=
this
,
var
g
=
this
,
key
,
key
,
i
,
button_list
=
this
.
props
.
add_buttons
,
objects
=
this
.
props
.
objects
,
objects
=
this
.
props
.
objects
,
element
=
getSubGadgetElement
(
g
,
scope
),
element
=
getSubGadgetElement
(
g
,
scope
),
parent
=
element
.
getAttribute
(
"
data-json-parent
"
),
parent
=
element
.
getAttribute
(
"
data-json-parent
"
),
...
@@ -1253,6 +1284,9 @@
...
@@ -1253,6 +1284,9 @@
tasks
.
push
(
g
.
props
.
add_custom_data
[
key
].
rerender
());
tasks
.
push
(
g
.
props
.
add_custom_data
[
key
].
rerender
());
}
}
}
}
for
(
i
=
0
;
i
<
button_list
.
length
;
i
=
i
+
1
)
{
tasks
.
push
(
button_list
[
i
].
rerender
());
}
tasks
.
push
(
checkValidityAndNotifyChange
(
g
));
tasks
.
push
(
checkValidityAndNotifyChange
(
g
));
return
RSVP
.
Queue
()
return
RSVP
.
Queue
()
.
push
(
function
()
{
.
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