Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ecommerce-ui
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
nexedi
ecommerce-ui
Commits
181b5b16
Commit
181b5b16
authored
Dec 19, 2013
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added reset-state property to form
parent
08317c8b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
data/person_view.json
data/person_view.json
+1
-0
js/erp5_loader.js
js/erp5_loader.js
+23
-2
No files found.
data/person_view.json
View file @
181b5b16
...
...
@@ -9,6 +9,7 @@
"dynamic_children"
:
[
0
],
"requires_authentication"
:
true
,
"depends_on"
:
"login_state"
,
"reset"
:
"login_state"
,
"allow_new"
:
true
},
"children"
:
[{
...
...
js/erp5_loader.js
View file @
181b5b16
...
...
@@ -1167,6 +1167,11 @@
spec
.
depend
=
spec
.
property_dict
.
depends_on
;
}
// set state reset flag
if
(
spec
.
property_dict
.
resets
)
{
spec
.
reset
=
spec
.
property_dict
.
resets
;
}
// when updating we only need a fragment container. Otherwise we
// generate the full gadget
if
(
update
)
{
...
...
@@ -1232,6 +1237,11 @@
spec
.
depend
=
spec
.
property_dict
.
depends_on
;
}
// set state reset flag
if
(
spec
.
property_dict
.
resets
)
{
spec
.
reset
=
spec
.
property_dict
.
resets
;
}
// set placeholders
placeholder
=
spec
.
placeholder_dict
||
{};
...
...
@@ -1329,18 +1339,24 @@
* @return {object} fragment
**/
"
fieldlist
"
:
function
(
spec
,
answer
,
field_dict
,
update
,
url_pointer
)
{
var
i
,
element
,
target
,
placeholder
,
update_gadget
;
var
i
,
element
,
target
,
placeholder
,
update_gadget
,
reset_state
;
// set update of gadget flag
if
(
spec
.
property_dict
.
depends_on
)
{
update_gadget
=
spec
.
property_dict
.
depends_on
;
}
// set state reset flag
if
(
spec
.
property_dict
.
reset
)
{
reset_state
=
spec
.
property_dict
.
reset
;
}
// set placeholders
placeholder
=
spec
.
placeholder_dict
||
{};
// no auth, no allow
if
(
answer
===
null
)
{
spec
.
reset
=
reset_state
;
spec
.
depend
=
update_gadget
;
target
=
factory
.
util
.
wrapInForm
(
spec
);
target
.
appendChild
(
app
.
noItemsFound
(
placeholder
.
no_auth
));
...
...
@@ -1372,6 +1388,7 @@
}
}
element
.
depend
=
update_gadget
;
element
.
reset
=
reset_state
;
element
.
form
=
spec
.
form
;
element
.
fields
=
field_dict
;
element
.
id
=
spec
.
id
;
...
...
@@ -1634,7 +1651,10 @@
"
className
"
:
(
spec
.
class_list
||
""
)
},
{
"
data-ajax
"
:
false
,
"
autocomplete
"
:
"
off
"
},
{
"
data-depend
"
:
spec
.
depend
||
null
}
{
"
data-depend
"
:
spec
.
depend
||
null
,
"
data-reset
"
:
spec
.
reset
||
null
}
);
}
return
document
.
createDocumentFragment
();
...
...
@@ -3789,6 +3809,7 @@
})
.
then
(
function
(
answer
)
{
// TODO: This is not the correct place to run all status updates!
if
(
answer
.
response
.
result
===
"
success
"
)
{
switch
(
config
.
gadget
.
getAttribute
(
"
data-reset
"
))
{
case
"
login_state
"
:
...
...
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