You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
812 B
22 lines
812 B
odoo.define('website_restrict_company.countries', function(require) {
|
|
"use strict";
|
|
const ajax = require('web.ajax');
|
|
var publicWidget = require('web.public.widget');
|
|
// Extended PublicWidget
|
|
publicWidget.registry.Country_detail = publicWidget.Widget.extend({
|
|
selector: ".js_countrymenu",
|
|
events: {
|
|
'click .js_countries': 'OnClickChangeCountry',
|
|
},
|
|
// Added a Click function to select the country
|
|
OnClickChangeCountry: function(e) {
|
|
event.preventDefault(e);
|
|
var country_id = e.currentTarget.dataset['country_id']
|
|
var self = this;
|
|
ajax.jsonRpc('/website/countries', 'call', { 'country_id': country_id})
|
|
.then(result => {
|
|
$(e.currentTarget).parent().parent().html(result)
|
|
});
|
|
},
|
|
});
|
|
});
|
|
|