Fix RTL switching sides of menus and buttons

main
Peter Jaszkowiak 7 years ago
parent 8328c08bed
commit a38221f1c9

@ -56,6 +56,10 @@
line-height: 30px; line-height: 30px;
border: none; border: none;
html[data-dir="rtl"] button& {
margin-left: 0;
}
.header & .notification-icon { .header & .notification-icon {
left: auto; left: auto;
right: 7px; right: 7px;

@ -118,20 +118,24 @@ $(document).ready(function() {
// initialization // initialization
var guest = !app.user || !parseInt(app.user.uid, 10); var guest = !app.user || !parseInt(app.user.uid, 10);
var legacy = !!Storage.getItem('persona:menus:legacy-layout'); var swapped = !!Storage.getItem('persona:menus:legacy-layout');
var margin = window.innerWidth; var margin = window.innerWidth;
if (legacy) { if (swapped) {
$('#mobile-menu').removeClass('pull-left'); $('#mobile-menu').removeClass('pull-left');
$('#mobile-chats').addClass('pull-left'); $('#mobile-chats').addClass('pull-left');
} }
if (document.documentElement.getAttribute('data-dir') === 'rtl') {
swapped = !swapped;
}
var navSlideout = Pulling.create({ var navSlideout = Pulling.create({
panel: document.getElementById('panel'), panel: document.getElementById('panel'),
menu: document.getElementById('menu'), menu: document.getElementById('menu'),
width: 256, width: 256,
margin: margin, margin: margin,
side: legacy ? 'right' : 'left', side: swapped ? 'right' : 'left',
}); });
$('#menu').removeClass('hidden'); $('#menu').removeClass('hidden');
@ -142,7 +146,7 @@ $(document).ready(function() {
menu: document.getElementById('chats-menu'), menu: document.getElementById('chats-menu'),
width: 256, width: 256,
margin: margin, margin: margin,
side: legacy ? 'left' : 'right', side: swapped ? 'left' : 'right',
}); });
$('#chats-menu').removeClass('hidden'); $('#chats-menu').removeClass('hidden');
} }

Loading…
Cancel
Save