Fix rtl stylesheet

This commit is contained in:
cristij 2018-09-02 14:34:19 +03:00
parent bf08083330
commit a8cb1967b0

View File

@ -14,11 +14,22 @@ export default {
this.isRTL = true;
this.getDocClasses().add('rtl');
this.getDocClasses().add('menu-on-right');
this.toggleBootstrapRTL(true);
},
disableRTL() {
this.isRTL = false;
this.getDocClasses().remove('rtl');
this.getDocClasses().remove('menu-on-right');
this.toggleBootstrapRTL(false);
},
toggleBootstrapRTL(value) {
for (let i=0; i < document.styleSheets.length; i++){
let styleSheet = document.styleSheets[i];
let { href } = styleSheet;
if(href && href.endsWith('bootstrap-rtl.css')){
styleSheet.disabled = !value;
}
}
}
}
});