diff --git a/dev/Common/UtilsUser.js b/dev/Common/UtilsUser.js index 63cb64da4..a45fee974 100644 --- a/dev/Common/UtilsUser.js +++ b/dev/Common/UtilsUser.js @@ -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(); } }, diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php index b4a820135..c3ce7fb4c 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -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; diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/User.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/User.php index cb6f1d103..526a92190 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/User.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/User.php @@ -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');