[REF] website_event: 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>
This commit is contained in:
Vincent Schippefilt
2019-03-06 20:07:17 +01:00
committed by Aaron Bohy
co-authored by Aaron Bohy Christophe Matthieu Mathieu Duckerts-Antoine David Monjoie Martin Geubelle svs-odoo
parent 7a899753c1
commit a8e8184048
3 changed files with 7 additions and 6 deletions
@@ -21,7 +21,7 @@ WebsiteNewMenu.include({
* and redirects the user to this new event.
*
* @private
* @returns {Deferred} Unresolved if there is a redirection
* @returns {Promise} Unresolved if there is a redirection
*/
_createNewEvent: function () {
var self = this;
@@ -29,7 +29,8 @@ WebsiteNewMenu.include({
id: "editor_new_event",
window_title: _t("New Event"),
input: _t("Event Name"),
}).then(function (eventName) {
}).then(function (result) {
var eventName = result.val;
if (!eventName) {
return;
}
@@ -40,7 +41,7 @@ WebsiteNewMenu.include({
},
}).then(function (url) {
window.location.href = url;
return $.Deferred();
return new Promise(function () {});
});
});
},
@@ -36,7 +36,7 @@ var EventRegistrationForm = Widget.extend({
$('<div class="alert alert-info"/>')
.text(_t('Please select at least one ticket.'))
.insertAfter('#registration_form table');
return $.Deferred();
return new Promise(function () {});
} else {
$button.attr('disabled', true);
return ajax.jsonRpc($form.attr('action'), 'call', post).then(function (modal) {
@@ -65,7 +65,7 @@ publicWidget.registry.EventRegistrationFormInstance = publicWidget.Widget.extend
start: function () {
var def = this._super.apply(this, arguments);
var instance = new EventRegistrationForm(this);
return $.when(def, instance.appendTo(this.$el));
return Promise.all([def, instance.appendTo(this.$el)]);
},
});
@@ -17,7 +17,7 @@ publicWidget.registry.visitor = publicWidget.Widget.extend({
self.$('.country_events_list').replaceWith(data);
}
}));
return $.when.apply($, defs);
return Promise.all(defs);
},
});
});