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
2849dc8b
Commit
2849dc8b
authored
Apr 24, 2014
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
app: add custom action allowing to update all gadgets on a page after a put
parent
a92ffff8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
0 deletions
+51
-0
js/erp5_loader.js
js/erp5_loader.js
+51
-0
No files found.
js/erp5_loader.js
View file @
2849dc8b
...
...
@@ -3027,6 +3027,57 @@
});
},
/**
* Same as put but since there is no time to make dyno interaction, we cheat!
* @method update
* @param {object} obj Action Object
**/
"
update_custom
"
:
function
(
obj
)
{
storage
.
write
(
obj
)
.
then
(
function
(
response
)
{
var
i
,
len
,
dyno_list
,
dyno
,
promise_list
;
// need to reload both dynos...
dyno_list
=
document
.
querySelectorAll
(
"
div.dyno
"
);
promise_list
=
[];
for
(
i
=
0
,
len
=
dyno_list
.
length
;
i
<
len
;
i
+=
1
)
{
dyno
=
dyno_list
[
i
];
// update gadgets
promise_list
[
i
]
=
app
.
content
.
set
(
{
"
portal_type_source
"
:
dyno
.
state
.
type
,
"
portal_type_title
"
:
dyno
.
state
.
title
,
"
property_dict
"
:
util
.
mergeObject
(
{
"
dynamic
"
:
true
},
dyno
.
state
.
dyno_dict
),
"
scheme
"
:
dyno
.
state
.
scheme
},
{
"
reference
"
:
dyno
.
id
,
"
href
"
:
dyno
.
state
.
href
,
"
fragment_list
"
:
dyno
.
state
.
fragment_list
,
"
layout_level
"
:
dyno
.
state
.
layout_level
},
false
)
.
fail
(
app
.
util
.
error
);
}
RSVP
.
all
(
promise_list
)
.
then
(
function
(
response_list
)
{
app
.
util
.
loader
(
""
,
"
status_dict.saved
"
,
"
check
"
);
})
.
fail
(
app
.
util
.
error
);
})
.
then
(
app
.
setPageBindings
)
.
fail
(
function
(
error
)
{
switch
(
error
.
status
)
{
case
408
:
app
.
util
.
loader
(
""
,
"
status_dict.timeout
"
,
"
clock-o
"
);
break
;
case
400
:
app
.
util
.
loader
(
""
,
"
validation_dict.general
"
,
"
ban
"
);
break
;
default
:
app
.
util
.
loader
(
""
,
"
status_dict.error
"
,
"
ban
"
);
break
;
}
});
},
/**
* Look up single value from dict
* @method translateLookup
...
...
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