[mobile] fix bug 57560

This commit is contained in:
Maxim Kadushkin 2022-07-12 10:41:09 +03:00
parent 06deb0f09d
commit f4aacf7030
5 changed files with 24 additions and 18 deletions

View file

@ -7,3 +7,19 @@ if ( !obj ) {
}
document.body.classList.add(`theme-type-${obj.type}`);
const load_stylesheet = reflink => {
let link = document.createElement( "link" );
link.href = reflink;
link.type = "text/css";
link.rel = "stylesheet";
document.getElementsByTagName("head")[0].appendChild(link);
};
if ( !localStorage && localStorage.getItem('mode-direction') === 'rtl' ) {
document.body.classList.add('rtl');
load_stylesheet('./css/framework7-rtl.css')
} else {
load_stylesheet('./css/framework7.css')
}

View file

@ -16,13 +16,6 @@ window.$ = jQuery;
// Import Framework7 Styles
const htmlElem = document.querySelector('html');
const direction = LocalStorage.getItem('mode-direction');
direction === 'rtl' ? htmlElem.setAttribute('dir', 'rtl') : htmlElem.setAttribute('dir', 'ltr');
import(`framework7/framework7-bundle${direction === 'rtl' ? '-rtl' : ''}.css`);
// Import Icons and App Custom Styles
// import '../css/icons.css';
import('./less/app.less');

View file

@ -15,10 +15,6 @@ window.jQuery = jQuery;
window.$ = jQuery;
// Import Framework7 or Framework7-RTL Styles
let direction = LocalStorage.getItem('mode-direction');
direction === 'rtl' ? $$('html').attr('dir', 'rtl') : $$('html').removeAttr('dir')
import(`framework7/framework7-bundle${direction === 'rtl' ? '-rtl' : ''}.css`)
// Import App Custom Styles
import('./less/app.less');

View file

@ -16,13 +16,6 @@ window.$ = jQuery;
// Import Framework7 Styles
const htmlElem = document.querySelector('html');
const direction = LocalStorage.getItem('mode-direction');
direction === 'rtl' ? htmlElem.setAttribute('dir', 'rtl') : htmlElem.setAttribute('dir', 'ltr');
import(`framework7/framework7-bundle${direction === 'rtl' ? '-rtl' : ''}.css`);
// Import App Custom Styles
import('./less/app.less');

View file

@ -231,6 +231,14 @@ module.exports = {
}),
new CopyWebpackPlugin({
patterns: [
{
from: resolvePath('node_modules/framework7/framework7-bundle.css'),
to: `../../${editor}/mobile/css/framework7.css`,
},
{
from: resolvePath('node_modules/framework7/framework7-bundle-rtl.css'),
to: `../../${editor}/mobile/css/framework7-rtl.css`,
},
{
noErrorOnMissing: true,
from: resolvePath('src/static'),