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
8c970da5
Commit
8c970da5
authored
Mar 22, 2018
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop loopEventListener dependency
parent
17604d11
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
56 deletions
+29
-56
gadget_json_generated_form.html
gadget_json_generated_form.html
+0
-1
gadget_json_generated_form.js
gadget_json_generated_form.js
+29
-55
No files found.
gadget_json_generated_form.html
View file @
8c970da5
...
...
@@ -9,7 +9,6 @@
<link
href=
"gadget_erp5_page_slap_parameter_form.css"
rel=
"stylesheet"
type=
"text/css"
/>
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
<script
src=
"renderjs.js"
type=
"text/javascript"
></script>
<script
src=
"gadget_global.js"
></script>
<script
src=
"gadget_json_generated_form.js"
type=
"text/javascript"
></script>
</head>
<body>
...
...
gadget_json_generated_form.js
View file @
8c970da5
/*jslint nomen: true, maxlen: 200, indent: 2*/
/*global window, document, rJS, RSVP
, loopEventListener
*/
/*global window, document, rJS, RSVP */
(
function
(
window
,
document
,
rJS
,
RSVP
,
loopEventListener
)
{
(
function
(
window
,
document
,
rJS
,
RSVP
)
{
"
use strict
"
;
function
decodeJsonPointer
(
_str
)
{
...
...
@@ -812,62 +812,36 @@
});
})
.
declareJob
(
'
listenEvents
'
,
function
()
{
var
g
=
this
,
field_list
=
g
.
props
.
inputs
,
button_list
=
g
.
props
.
add_buttons
,
label_list
=
g
.
element
.
querySelectorAll
(
'
label.slapos-parameter-dict-key
'
),
i
,
promise_list
=
[];
if
(
g
.
props
.
delete_button
)
{
promise_list
.
push
(
loopEventListener
(
g
.
props
.
delete_button
,
'
click
'
,
false
,
g
.
selfRemove
.
bind
(
g
)
));
.
onEvent
(
'
click
'
,
function
(
evt
)
{
if
(
evt
.
target
===
this
.
props
.
delete_button
)
{
return
this
.
selfRemove
(
evt
);
}
if
(
g
.
props
.
property_name_edit
)
{
promise_list
.
push
(
loopEventListener
(
g
.
props
.
property_name_edit
,
'
change
'
,
false
,
function
(
event
)
{
return
g
.
rename
(
g
.
props
.
property_name_edit
.
value
,
event
);
var
button_list
=
this
.
props
.
add_buttons
,
i
;
for
(
i
=
0
;
i
<
button_list
.
length
;
i
=
i
+
1
)
{
if
(
evt
.
target
===
button_list
[
i
].
element
)
{
return
button_list
[
i
].
event
(
evt
);
}
));
}
})
for
(
i
=
0
;
i
<
field_list
.
length
;
i
=
i
+
1
)
{
promise_list
.
push
(
loopEventListener
(
field_list
[
i
],
'
change
'
,
false
,
g
.
processValidation
.
bind
(
g
,
g
.
options
.
schema_url
,
undefined
)
));
.
onEvent
(
'
change
'
,
function
(
evt
)
{
if
(
evt
.
target
===
this
.
props
.
property_name_edit
)
{
return
this
.
rename
(
this
.
props
.
property_name_edit
.
value
,
evt
);
}
for
(
i
=
0
;
i
<
button_list
.
length
;
i
=
i
+
1
)
{
promise_list
.
push
(
loopEventListener
(
button_list
[
i
].
element
,
'
click
'
,
false
,
button_list
[
i
].
event
));
}
// for (i = 0; i < label_list.length; i = i + 1) {
// promise_list.push(loopEventListener(
// label_list[i],
// 'click',
// false,
// collapseParameter.bind(g, label_list[i])
// ));
// }
return
RSVP
.
all
(
promise_list
);
var
field_list
=
this
.
props
.
inputs
,
i
;
for
(
i
=
0
;
i
<
field_list
.
length
;
i
=
i
+
1
)
{
if
(
evt
.
target
===
field_list
[
i
].
element
)
{
return
this
.
processValidation
.
bind
(
this
,
this
.
options
.
schema_url
,
undefined
)(
evt
);
}
}
})
.
declareJob
(
'
listenEvents
'
,
function
()
{
// XXX Disable
return
;
})
.
declareMethod
(
'
getContent
'
,
function
()
{
...
...
@@ -882,4 +856,4 @@
// });
});
}(
window
,
document
,
rJS
,
RSVP
,
loopEventListener
));
\ No newline at end of file
}(
window
,
document
,
rJS
,
RSVP
));
\ No newline at end of file
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