Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
erp5
Commits
af39d338
Commit
af39d338
authored
Apr 30, 2019
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_json_form] update from
https://lab.nexedi.com/bk/rjs_json_form
parent
dd153d95
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
28 deletions
+42
-28
bt5/erp5_json_form/SkinTemplateItem/portal_skins/erp5_json_form/jsonform.gadget.js.js
...ateItem/portal_skins/erp5_json_form/jsonform.gadget.js.js
+2
-2
bt5/erp5_json_form/SkinTemplateItem/portal_skins/erp5_json_form/jsonform/gadget_json_generated_form_child.js.js
...json_form/jsonform/gadget_json_generated_form_child.js.js
+40
-26
No files found.
bt5/erp5_json_form/SkinTemplateItem/portal_skins/erp5_json_form/jsonform.gadget.js.js
View file @
af39d338
/*jslint nomen: true, maxlen: 200, indent: 2, maxerr: 100*/
/*global window, document, URL, rJS, RSVP, jIO, Blob
*/
/*global window, document, URL, rJS, RSVP, jIO, Blob
, console
*/
(
function
(
window
,
document
,
Blob
,
rJS
,
RSVP
,
jIO
)
{
"
use strict
"
;
...
...
@@ -1009,7 +1009,7 @@
if
(
opt
.
scope
)
{
queue
.
push
(
function
()
{
return
g
.
props
.
form_gadget
.
getDeclared
Gadget
(
opt
.
scope
);
return
g
.
getSub
Gadget
(
opt
.
scope
);
})
.
push
(
function
(
ret
)
{
gadget
=
ret
;
...
...
bt5/erp5_json_form/SkinTemplateItem/portal_skins/erp5_json_form/jsonform/gadget_json_generated_form_child.js.js
View file @
af39d338
/*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
"
)
,
g
.
rNotifyChange
({
scope
:
v
.
scope
,
rel_path
:
v
.
path
,
path
:
p
,
ref
:
g
.
props
.
schema_arr
.
external_reference
,
...
...
@@ -2066,12 +2074,14 @@
evt
=
arr
[
0
],
event_object
;
event_object
=
g
.
props
.
add_custom_data
[
sub_scope
];
if
(
event_object
&&
evt
.
type
===
"
change
"
)
{
return
event_object
.
event
();
if
(
evt
.
type
===
"
change
"
)
{
if
(
event_object
)
{
return
event_object
.
event
();
}
return
g
.
rootNotifyChange
({
path
:
evt
.
target
.
name
});
}
return
g
.
rootNotifyChange
({
path
:
evt
.
target
.
name
});
})
.
declareMethod
(
'
renderForm
'
,
function
(
options
)
{
var
g
=
this
,
...
...
@@ -2161,6 +2171,10 @@
.
push
(
function
()
{
g
.
props
.
rerender
=
false
;
return
g
.
element
;
})
.
push
(
undefined
,
function
(
err
)
{
console
.
error
(
err
);
throw
err
;
});
})
...
...
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