Merge branch 'master-issue-105-switch-to-non-language' into 'master'
[FIX] Issue #105 switch the user to non language See merge request flectra-hq/flectra!140
This commit is contained in:
commit
0242ea14b1
@ -161,30 +161,32 @@ var UserProfile = Widget.extend({
|
||||
method: 'search_read',
|
||||
args: [[["code", "=", session.user_context.lang]], ['name', 'direction']],
|
||||
}).then(function(lang_data){
|
||||
var img_src = session.url('/web/image', {
|
||||
model:'res.lang',
|
||||
field: 'image',
|
||||
id: lang_data[0].id,
|
||||
});
|
||||
$lang_logo.attr('title', lang_data[0].name).attr('src', img_src).attr('data-lang-dir', lang_data[0].direction);
|
||||
if (lang_data.length) {
|
||||
var img_src = session.url('/web/image', {
|
||||
model: 'res.lang',
|
||||
field: 'image',
|
||||
id: lang_data[0].id,
|
||||
});
|
||||
$lang_logo.attr('title', lang_data[0].name).attr('src', img_src).attr('data-lang-dir', lang_data[0].direction);
|
||||
|
||||
// Web RTL(Right to Left) Snippet
|
||||
if (lang_data[0].direction == 'rtl') {
|
||||
var head = document.getElementsByTagName('head')[0];
|
||||
// Web RTL(Right to Left) Snippet
|
||||
if (lang_data[0].direction == 'rtl') {
|
||||
var head = document.getElementsByTagName('head')[0];
|
||||
|
||||
// BootStrap RTL CSS
|
||||
var link = document.createElement('link');
|
||||
link.rel = 'stylesheet';
|
||||
link.type = 'text/css';
|
||||
link.href = '/web/static/lib/rtl/bootstrap-rtl.min.css';
|
||||
head.appendChild(link);
|
||||
// BootStrap RTL CSS
|
||||
var link = document.createElement('link');
|
||||
link.rel = 'stylesheet';
|
||||
link.type = 'text/css';
|
||||
link.href = '/web/static/lib/rtl/bootstrap-rtl.min.css';
|
||||
head.appendChild(link);
|
||||
|
||||
// Flectra RTL Custom CSS
|
||||
var link1 = document.createElement('link');
|
||||
link1.rel = 'stylesheet';
|
||||
link1.type = 'text/css';
|
||||
link1.href = '/web/static/lib/rtl/flectra-rtl-custom.css';
|
||||
head.appendChild(link1);
|
||||
// Flectra RTL Custom CSS
|
||||
var link1 = document.createElement('link');
|
||||
link1.rel = 'stylesheet';
|
||||
link1.type = 'text/css';
|
||||
link1.href = '/web/static/lib/rtl/flectra-rtl-custom.css';
|
||||
head.appendChild(link1);
|
||||
}
|
||||
}
|
||||
});
|
||||
$avatar.attr('src', avatar_src);
|
||||
|
Loading…
Reference in New Issue
Block a user