#rl-content to use flex for better layout control

This commit is contained in:
the-djmaze 2023-01-26 14:11:30 +01:00
parent cfcc8c73af
commit 8047a36b70
8 changed files with 42 additions and 70 deletions

View file

@ -256,11 +256,10 @@ export class AppUser extends AbstractApp {
// initLeftSideLayoutResizer // initLeftSideLayoutResizer
setTimeout(() => { setTimeout(() => {
const left = elementById('rl-left'), const left = elementById('rl-left'),
right = elementById('rl-right'),
fToggle = () => fToggle = () =>
setLayoutResizer(left, right, ClientSideKeyNameFolderListSize, setLayoutResizer(left, null, ClientSideKeyNameFolderListSize,
(ThemeStore.isMobile() || leftPanelDisabled()) ? 0 : 'Width'); (ThemeStore.isMobile() || leftPanelDisabled()) ? 0 : 'Width');
if (left && right) { if (left) {
fToggle(); fToggle();
leftPanelDisabled.subscribe(fToggle); leftPanelDisabled.subscribe(fToggle);
} }

View file

@ -199,7 +199,7 @@ showMessageComposer = (params = []) =>
setLayoutResizer = (source, target, sClientSideKeyName, mode) => setLayoutResizer = (source, target, sClientSideKeyName, mode) =>
{ {
if (source.layoutResizer && source.layoutResizer.mode != mode) { if (source.layoutResizer && source.layoutResizer.mode != mode) {
target.removeAttribute('style'); target?.removeAttribute('style');
source.removeAttribute('style'); source.removeAttribute('style');
} }
source.observer?.disconnect(); source.observer?.disconnect();
@ -210,10 +210,10 @@ setLayoutResizer = (source, target, sClientSideKeyName, mode) =>
let value; let value;
if ('Width' == mode) { if ('Width' == mode) {
value = source.offsetWidth; value = source.offsetWidth;
target.style.left = value + 'px'; target && (target.style.left = value + 'px');
} else { } else {
value = source.offsetHeight; value = source.offsetHeight;
target.style.top = (4 + source.offsetTop + value) + 'px'; target && (target.style.top = value + 'px');
} }
return value; return value;
}; };

View file

@ -7,7 +7,6 @@
#rl-left { #rl-left {
flex-grow: 0; flex-grow: 0;
flex-shrink: 0; flex-shrink: 0;
overflow: auto;
padding-top: 50px + @rlLowMargin + 10px; padding-top: 50px + @rlLowMargin + 10px;
transition: width 0.3s ease-out; transition: width 0.3s ease-out;
width: @rlLeftWidth; width: @rlLeftWidth;

View file

@ -106,7 +106,7 @@ dialog .modal-body {
// Footer (for actions) // Footer (for actions)
dialog > footer { dialog > footer {
padding: 14px 15px 15px; padding: 9px 15px;
margin-bottom: 0; margin-bottom: 0;
text-align: right; // right align buttons text-align: right; // right align buttons
border-top: 1px solid var(--border-color, #ddd); border-top: 1px solid var(--border-color, #ddd);

View file

@ -6,7 +6,7 @@
> * { > * {
position: absolute; position: absolute;
right: 0; right: 2px;
left: 0; left: 0;
} }
@ -237,9 +237,6 @@ html.rl-left-panel-disabled {
margin-top: 10px !important; margin-top: 10px !important;
margin-left: 0 !important; margin-left: 0 !important;
} }
&.rl-mobile #rl-left {
visibility: hidden;
}
} }
html.rl-mobile .b-folders .b-content { html.rl-mobile .b-folders .b-content {

View file

@ -5,22 +5,25 @@
background-position: center; background-position: center;
} }
#rl-left, #rl-right { #rl-content {
position: fixed; display:flex;
top: 0; height: 100%;
right: 0;
bottom: 10px;
left: 0;
} }
#rl-left { #rl-left {
z-index: 0; flex-grow: 0;
flex-shrink: 0;
position: relative;
/* transition: width 0.3s ease-out;*/
width: @rlLeftWidth; width: @rlLeftWidth;
z-index: 0;
} }
#rl-right { #rl-right {
flex-grow: 1;
max-width: 100vw;
position: relative;
z-index: 1; z-index: 1;
left: @rlLeftWidth;
} }
/* /*
@ -54,8 +57,7 @@
} }
html:not(.rl-left-panel-disabled) #rl-left { html:not(.rl-left-panel-disabled) #rl-left {
resize: horizontal; resize: horizontal; overflow: auto;
overflow: hidden;
min-width: 155px; min-width: 155px;
max-width: 350px; max-width: 350px;
} }
@ -70,12 +72,12 @@ html:not(.rl-left-panel-disabled) #rl-left {
} }
.rl-side-preview-pane #V-MailMessageList { .rl-side-preview-pane #V-MailMessageList {
resize: horizontal; resize: horizontal; overflow: auto;
min-width: 320px; min-width: 320px;
max-width: 60%; max-width: 60%;
} }
.rl-bottom-preview-pane #V-MailMessageList { .rl-bottom-preview-pane #V-MailMessageList {
resize: vertical; resize: vertical; overflow: auto;
min-height: 200px; min-height: 200px;
max-height: 60%; max-height: 60%;
} }
@ -205,10 +207,6 @@ html.rl-side-preview-pane {
width: @rlLeftWidth + 20; width: @rlLeftWidth + 20;
} }
#rl-right {
left: @rlLeftWidth + 20;
}
#V-MailMessageList { #V-MailMessageList {
width: 40%; width: 40%;
} }
@ -226,10 +224,6 @@ html.rl-side-preview-pane {
width: 155px; width: 155px;
} }
#rl-right {
left: 155px;
}
#rl-settings-subscreen { #rl-settings-subscreen {
padding: 10px; padding: 10px;
} }
@ -262,16 +256,15 @@ html.rl-left-panel-disabled {
display: none; display: none;
} }
} }
#rl-right {
left: 60px;
}
} }
html.rl-no-preview-pane { html.rl-no-preview-pane {
#V-MailMessageList { #V-MailMessageList {
width: inherit; position: absolute;
left: 0;
right: 0;
width: auto;
} }
} }
@ -281,18 +274,27 @@ html.rl-no-preview-pane #rl-right .resizer {
display: none !important; display: none !important;
} }
html.rl-mobile {
&.rl-left-panel-disabled #rl-left {
display: none;
}
#rl-right {
min-width: 100vw;
}
}
html.rl-bottom-preview-pane { html.rl-bottom-preview-pane {
#V-MailMessageList { #V-MailMessageList {
bottom: inherit;
width: inherit;
height: 300px; height: 300px;
position: absolute;
left: 0;
right: 0; right: 0;
width: auto;
} }
#V-MailMessageView { #V-MailMessageView {
left: 0; top: 300px;
top: 356px;
} }
} }
@ -321,14 +323,3 @@ html:not(.rl-mobile) .show-mobile {
} }
} }
} }
html.rl-mobile {
&:not(.rl-left-panel-disabled) #rl-right {
right: -150px;
}
&.rl-left-panel-disabled #rl-right {
left: 0;
}
}

View file

@ -476,20 +476,11 @@ html.rl-fullscreen {
display: none !important; display: none !important;
} }
#rl-right { #V-MailMessageList,
left: 0 !important; #V-SettingsPane,
#V-MailMessageList,
#V-SettingsPane,
#V-SystemDropDown,
#V-MailMessageView .messageView .toolbar {
display: none !important;
}
}
#V-SystemDropDown, #V-SystemDropDown,
.messageView .top-toolbar { #V-MailMessageView .messageView .toolbar {
display: none; display: none !important;
} }
.messageView { .messageView {

View file

@ -9,11 +9,6 @@ This stylesheet is used when SnappyMail runs in embed mode.
min-height: 100%; min-height: 100%;
} }
#content #rl-app:not([data-admin="1"]) #rl-left,
#content #rl-app:not([data-admin="1"]) #rl-right {
position: absolute;
}
.squire-wysiwyg { .squire-wysiwyg {
min-width: 100%; min-width: 100%;
min-height: 100%; min-height: 100%;