This commit is contained in:
the-djmaze 2022-06-08 23:40:28 +02:00
parent 61146e491b
commit 38836da9af
3 changed files with 18 additions and 11 deletions

View file

@ -181,12 +181,13 @@ setLayoutResizer = (source, target, sClientSideKeyName, mode) =>
target.removeAttribute('style');
source.removeAttribute('style');
}
source.observer && source.observer.disconnect();
// source.classList.toggle('resizable', mode);
if (mode) {
const length = Local.get(sClientSideKeyName + mode) || SettingsGet('Resizer' + sClientSideKeyName + mode),
setTarget = () => {
setTargetPos = mode => {
let value;
if ('Width' == source.layoutResizer.mode) {
if ('Width' == mode) {
value = source.offsetWidth;
target.style.left = value + 'px';
} else {
@ -195,14 +196,19 @@ setLayoutResizer = (source, target, sClientSideKeyName, mode) =>
}
return value;
};
if (length) {
source.style[mode.toLowerCase()] = length + 'px';
setTargetPos(mode);
}
if (!source.layoutResizer) {
const resizer = createElement('div', {'class':'resizer'}),
save = (data => Remote.saveSettings(0, data)).debounce(500),
size = {},
store = () => {
let value = setTarget(),
const value = setTargetPos(resizer.mode),
prop = resizer.key + resizer.mode;
Local.set(prop, value);
// Remote.saveSettings(0, {['Resizer' + prop]:value}); // TODO: needs delay
(value == Local.get(prop)) || Local.set(prop, value);
(value == SettingsGet('Resizer' + prop)) || save({['Resizer' + prop]: value});
},
cssint = s => {
let value = getComputedStyle(source, null)[s].replace('px', '');
@ -243,12 +249,6 @@ setLayoutResizer = (source, target, sClientSideKeyName, mode) =>
source.layoutResizer.mode = mode;
source.layoutResizer.key = sClientSideKeyName;
source.observer && source.observer.observe(source, { box: 'border-box' });
if (length) {
source.style[mode.toLowerCase()] = length + 'px';
setTarget();
}
} else {
source.observer && source.observer.disconnect();
}
},

View file

@ -862,6 +862,9 @@ class Actions
$aResult['AllowDraftAutosave'] = (bool)$oSettings->GetConf('AllowDraftAutosave', $aResult['AllowDraftAutosave']);
$aResult['AutoLogout'] = (int)$oSettings->GetConf('AutoLogout', $aResult['AutoLogout']);
$aResult['Layout'] = (int)$oSettings->GetConf('Layout', $aResult['Layout']);
$aResult['Resizer4Width'] = (int)$oSettings->GetConf('Resizer4Width', 0);
$aResult['Resizer5Width'] = (int)$oSettings->GetConf('Resizer5Width', 0);
$aResult['Resizer5Height'] = (int)$oSettings->GetConf('Resizer5Height', 0);
if (!$this->GetCapa(Enumerations\Capa::AUTOLOGOUT)) {
$aResult['AutoLogout'] = 0;

View file

@ -342,6 +342,10 @@ trait User
$this->setSettingsFromParams($oSettings, 'AutoLogout', 'int');
$this->setSettingsFromParams($oSettings, 'MessageReadDelay', 'int');
$this->setSettingsFromParams($oSettings, 'Resizer4Width', 'int');
$this->setSettingsFromParams($oSettings, 'Resizer5Width', 'int');
$this->setSettingsFromParams($oSettings, 'Resizer5Height', 'int');
$this->setSettingsFromParams($oSettingsLocal, 'UseThreads', 'bool');
$this->setSettingsFromParams($oSettingsLocal, 'ReplySameFolder', 'bool');
$this->setSettingsFromParams($oSettingsLocal, 'HideUnsubscribed', 'bool');