summaryrefslogtreecommitdiff
path: root/addons/web_settings_dashboard/static/src/js/dashboard.js
diff options
context:
space:
mode:
authorVincent Schippefilt <vsc@odoo.com>2019-03-06 14:02:33 +0100
committerAaron Bohy <aab@odoo.com>2019-03-06 20:07:17 +0100
commit8356a00a68ebdc97829d6b4b2896bdcec9a6b67f (patch)
tree19c2429522c68d545fed9a3b7f982b40b500aabb /addons/web_settings_dashboard/static/src/js/dashboard.js
parent7bc550fb8d3fba2400db345818de321a08537a39 (diff)
[REF] web_settings_dashboard: adapt code after jQuery update
Part of task 1896658 Co-authored-by: Aaron Bohy <aab@odoo.com> Co-authored-by: Christophe Matthieu <chm@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> Co-authored-by: David Monjoie <dmo@odoo.com> Co-authored-by: Martin Geubelle <mge@odoo.com> Co-authored-by: svs-odoo <svs@odoo.com> Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
Diffstat (limited to 'addons/web_settings_dashboard/static/src/js/dashboard.js')
-rw-r--r--addons/web_settings_dashboard/static/src/js/dashboard.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/addons/web_settings_dashboard/static/src/js/dashboard.js b/addons/web_settings_dashboard/static/src/js/dashboard.js
index a51b5c173b5..9807a00d001 100644
--- a/addons/web_settings_dashboard/static/src/js/dashboard.js
+++ b/addons/web_settings_dashboard/static/src/js/dashboard.js
@@ -20,13 +20,13 @@ var Dashboard = AbstractAction.extend({
start: function(){
var superDef = this._super.apply(this, arguments);
- return $.when(superDef, this.load(this.all_dashboards));
+ return Promise.all([superDef, this.load(this.all_dashboards)]);
},
load: function(dashboards){
var self = this;
- var loading_done = new $.Deferred();
- this._rpc({route: '/web_settings_dashboard/data'})
+ return new Promise(function (resolve, reject) {
+ self._rpc({route: '/web_settings_dashboard/data'})
.then(function (data) {
// Load each dashboard
var all_dashboards_defs = [];
@@ -37,12 +37,12 @@ var Dashboard = AbstractAction.extend({
}
});
- // Resolve loading_done when all dashboards defs are resolved
- $.when.apply($, all_dashboards_defs).then(function() {
- loading_done.resolve();
+ // Resolve the promise when all dashboards defs are resolved
+ Promise.all(all_dashboards_defs).then(function() {
+ resolve();
});
});
- return loading_done;
+ });
},
load_apps: function(data){
@@ -220,7 +220,7 @@ var DashboardInvitations = Widget.extend({
.then(function () {
self.reload();
})
- .fail(function () {
+ .guardedCatch(function () {
$button.button('reset');
});
}