mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-12-31 03:52:01 +08:00
Resolve #328
This commit is contained in:
parent
61146e491b
commit
38836da9af
3 changed files with 18 additions and 11 deletions
|
@ -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();
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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');
|
||||
|
|
Loading…
Reference in a new issue