apply rtl on app initialize

pull/1319/head
Audric Ackermann 5 years ago
parent cf918b76b4
commit eabc2b30dc
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -13,6 +13,7 @@
this.inboxView = null; this.inboxView = null;
this.applyTheme(); this.applyTheme();
this.applyRtl();
this.applyHideMenu(); this.applyHideMenu();
this.showSeedDialog = this.showSeedDialog.bind(this); this.showSeedDialog = this.showSeedDialog.bind(this);
@ -21,20 +22,21 @@
events: { events: {
openInbox: 'openInbox', openInbox: 'openInbox',
}, },
applyTheme() { applyRtl() {
const rtlLocales = ['fa']; const rtlLocales = ['fa'];
const theme = storage.get('theme-setting') || 'light';
this.$el
.removeClass('light-theme')
.removeClass('dark-theme')
.removeClass('rtl')
.addClass(`${theme}-theme`);
const loc = window.i18n.getLocale(); const loc = window.i18n.getLocale();
if (rtlLocales.includes(loc)) { if (rtlLocales.includes(loc)) {
this.$el.addClass('rtl'); this.$el.addClass('rtl');
} }
}, },
applyTheme() {
const theme = storage.get('theme-setting') || 'light';
this.$el
.removeClass('light-theme')
.removeClass('dark-theme')
.addClass(`${theme}-theme`);
},
applyHideMenu() { applyHideMenu() {
const hideMenuBar = storage.get('hide-menu-bar', true); const hideMenuBar = storage.get('hide-menu-bar', true);
window.setAutoHideMenuBar(hideMenuBar); window.setAutoHideMenuBar(hideMenuBar);

Loading…
Cancel
Save