[rtl] fix left and right panels position for PE, SSE

This commit is contained in:
JuliaSvinareva 2022-10-19 17:55:12 +03:00
parent 011ac80554
commit feb696b8ec
4 changed files with 74 additions and 55 deletions

View file

@ -215,7 +215,7 @@ define([
this.viewport.hlayout.doLayout(); this.viewport.hlayout.doLayout();
break; break;
case 'history': case 'history':
var panel = this.viewport.hlayout.items[1]; var panel = this.viewport.hlayout.getItem('history');
if (panel.resize.el) { if (panel.resize.el) {
this.boxSdk.css('border-left', ''); this.boxSdk.css('border-left', '');
panel.resize.el.show(); panel.resize.el.show();
@ -223,7 +223,7 @@ define([
this.viewport.hlayout.doLayout(); this.viewport.hlayout.doLayout();
break; break;
case 'leftmenu': case 'leftmenu':
var panel = this.viewport.hlayout.items[0]; var panel = this.viewport.hlayout.getItem('left');
if (panel.resize.el) { if (panel.resize.el) {
if (panel.el.width() > 40) { if (panel.el.width() > 40) {
this.boxSdk.css('border-left', ''); this.boxSdk.css('border-left', '');

View file

@ -105,33 +105,42 @@ define([
$container = $('#viewport-hbox-layout', el); $container = $('#viewport-hbox-layout', el);
items = $container.find(' > .layout-item'); items = $container.find(' > .layout-item');
let iarray = [{
el: items[0],
rely: true,
alias: 'left',
resize: {
hidden: true,
autohide: false,
min: 300,
max: 600
}}, { // history versions
el: items[3],
rely: true,
alias: 'history',
resize: {
hidden: true,
autohide: false,
min: 300,
max: 600
}
}, {
el: items[1],
stretch: true
}, {
el: $(items[2]).hide(),
rely: true
}];
if ( Common.UI.isRTL() ) {
[iarray[0], iarray[3]] = [iarray[3], iarray[0]];
[iarray[1], iarray[2]] = [iarray[2], iarray[1]];
}
this.hlayout = new Common.UI.HBoxLayout({ this.hlayout = new Common.UI.HBoxLayout({
box: $container, box: $container,
items: [{ items: iarray
el: items[0],
rely: true,
resize: {
hidden: true,
autohide: false,
min: 300,
max: 600
}}, { // history versions
el: items[3],
rely: true,
resize: {
hidden: true,
autohide: false,
min: 300,
max: 600
}
}, {
el: items[1],
stretch: true
}, {
el: $(items[2]).hide(),
rely: true
}
]
}); });
return this; return this;

View file

@ -233,7 +233,7 @@ define([
this.viewport.hlayout.doLayout(); this.viewport.hlayout.doLayout();
break; break;
case 'history': case 'history':
var panel = this.viewport.hlayout.items[1]; var panel = this.viewport.hlayout.getItem('history');
if (panel.resize.el) { if (panel.resize.el) {
this.boxSdk.css('border-left', ''); this.boxSdk.css('border-left', '');
panel.resize.el.show(); panel.resize.el.show();
@ -241,7 +241,7 @@ define([
this.viewport.hlayout.doLayout(); this.viewport.hlayout.doLayout();
break; break;
case 'leftmenu': case 'leftmenu':
var panel = this.viewport.hlayout.items[0]; var panel = this.viewport.hlayout.getItem('left');
if (panel.resize.el) { if (panel.resize.el) {
if (panel.el.width() > 40) { if (panel.el.width() > 40) {
this.boxSdk.css('border-left', ''); this.boxSdk.css('border-left', '');

View file

@ -106,34 +106,44 @@ define([
$container = $('#viewport-hbox-layout', el); $container = $('#viewport-hbox-layout', el);
items = $container.find(' > .layout-item'); items = $container.find(' > .layout-item');
let iarray = [{
el: items[0],
rely: true,
alias: 'left',
resize: {
hidden: true,
autohide: false,
min: 300,
max: 600,
offset: 4
}
}, { // history versions
el: items[3],
rely: true,
alias: 'history',
resize: {
hidden: true,
autohide: false,
min: 300,
max: 600
}
}, {
el: items[1],
stretch: true
}, {
el: $(items[2]).hide(),
rely: true
}];
if ( Common.UI.isRTL() ) {
[iarray[0], iarray[3]] = [iarray[3], iarray[0]];
[iarray[1], iarray[2]] = [iarray[2], iarray[1]];
}
this.hlayout = new Common.UI.HBoxLayout({ this.hlayout = new Common.UI.HBoxLayout({
box: $container, box: $container,
items: [{ items: iarray
el: items[0],
rely: true,
resize: {
hidden: true,
autohide: false,
min: 300,
max: 600,
offset: 4
}
}, { // history versions
el: items[3],
rely: true,
resize: {
hidden: true,
autohide: false,
min: 300,
max: 600
}
}, {
el: items[1],
stretch: true
}, {
el: $(items[2]).hide(),
rely: true
}]
}); });
$container = $container.find('.layout-ct.vbox'); $container = $container.find('.layout-ct.vbox');