mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
"Use preview pane" settings refactoring (Layout)
This commit is contained in:
parent
6928fcc48e
commit
74ad0e2ca1
15 changed files with 284 additions and 246 deletions
|
|
@ -750,10 +750,13 @@ Utils.initDataConstructorBySettings = function (oData)
|
||||||
oData.desktopNotifications = ko.observable(false);
|
oData.desktopNotifications = ko.observable(false);
|
||||||
oData.useThreads = ko.observable(true);
|
oData.useThreads = ko.observable(true);
|
||||||
oData.replySameFolder = ko.observable(true);
|
oData.replySameFolder = ko.observable(true);
|
||||||
oData.usePreviewPane = ko.observable(true);
|
|
||||||
oData.layout = ko.observable(Enums.Layout.SidePreview);
|
|
||||||
oData.useCheckboxesInList = ko.observable(true);
|
oData.useCheckboxesInList = ko.observable(true);
|
||||||
|
|
||||||
|
oData.layout = ko.observable(Enums.Layout.SidePreview);
|
||||||
|
oData.usePreviewPane = ko.computed(function () {
|
||||||
|
return Enums.Layout.NoPreview !== oData.layout();
|
||||||
|
});
|
||||||
|
|
||||||
oData.interfaceAnimation.subscribe(function (sValue) {
|
oData.interfaceAnimation.subscribe(function (sValue) {
|
||||||
if (Globals.bMobileDevice || sValue === Enums.InterfaceAnimation.None)
|
if (Globals.bMobileDevice || sValue === Enums.InterfaceAnimation.None)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ MailBoxScreen.prototype.onRoute = function (sFolderHash, iPage, sSearch, bPrevie
|
||||||
{
|
{
|
||||||
if (Utils.isUnd(bPreview) ? false : !!bPreview)
|
if (Utils.isUnd(bPreview) ? false : !!bPreview)
|
||||||
{
|
{
|
||||||
if (!RL.data().usePreviewPane() && !RL.data().message())
|
if (Enums.Layout.NoPreview === RL.data().layout() && !RL.data().message())
|
||||||
{
|
{
|
||||||
RL.historyBack();
|
RL.historyBack();
|
||||||
}
|
}
|
||||||
|
|
@ -70,7 +70,7 @@ MailBoxScreen.prototype.onRoute = function (sFolderHash, iPage, sSearch, bPrevie
|
||||||
.messageListSearch(sSearch)
|
.messageListSearch(sSearch)
|
||||||
;
|
;
|
||||||
|
|
||||||
if (!oData.usePreviewPane() && oData.message())
|
if (Enums.Layout.NoPreview === oData.layout() && oData.message())
|
||||||
{
|
{
|
||||||
oData.message(null);
|
oData.message(null);
|
||||||
oData.messageFullScreenMode(false);
|
oData.messageFullScreenMode(false);
|
||||||
|
|
@ -110,14 +110,14 @@ MailBoxScreen.prototype.onStart = function ()
|
||||||
RL.remote().appDelayStart(Utils.emptyFunction);
|
RL.remote().appDelayStart(Utils.emptyFunction);
|
||||||
}, 35000);
|
}, 35000);
|
||||||
|
|
||||||
$html.toggleClass('rl-no-preview-pane', !oData.usePreviewPane());
|
$html.toggleClass('rl-no-preview-pane', Enums.Layout.NoPreview === oData.layout());
|
||||||
|
|
||||||
oData.folderList.subscribe(fResizeFunction);
|
oData.folderList.subscribe(fResizeFunction);
|
||||||
oData.messageList.subscribe(fResizeFunction);
|
oData.messageList.subscribe(fResizeFunction);
|
||||||
oData.message.subscribe(fResizeFunction);
|
oData.message.subscribe(fResizeFunction);
|
||||||
|
|
||||||
oData.usePreviewPane.subscribe(function (bValue) {
|
oData.layout.subscribe(function (nValue) {
|
||||||
$html.toggleClass('rl-no-preview-pane', !bValue);
|
$html.toggleClass('rl-no-preview-pane', Enums.Layout.NoPreview === nValue);
|
||||||
});
|
});
|
||||||
|
|
||||||
oData.foldersInboxUnreadCount.subscribe(function () {
|
oData.foldersInboxUnreadCount.subscribe(function () {
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,8 @@ function SettingsGeneral()
|
||||||
this.threading = oData.threading;
|
this.threading = oData.threading;
|
||||||
this.useThreads = oData.useThreads;
|
this.useThreads = oData.useThreads;
|
||||||
this.replySameFolder = oData.replySameFolder;
|
this.replySameFolder = oData.replySameFolder;
|
||||||
this.usePreviewPane = oData.usePreviewPane;
|
|
||||||
this.layout = oData.layout;
|
this.layout = oData.layout;
|
||||||
|
this.usePreviewPane = oData.usePreviewPane;
|
||||||
this.useCheckboxesInList = oData.useCheckboxesInList;
|
this.useCheckboxesInList = oData.useCheckboxesInList;
|
||||||
this.allowLanguagesOnSettings = oData.allowLanguagesOnSettings;
|
this.allowLanguagesOnSettings = oData.allowLanguagesOnSettings;
|
||||||
|
|
||||||
|
|
@ -43,6 +43,11 @@ function SettingsGeneral()
|
||||||
|
|
||||||
Utils.addSettingsViewModel(SettingsGeneral, 'SettingsGeneral', 'SETTINGS_LABELS/LABEL_GENERAL_NAME', 'general', true);
|
Utils.addSettingsViewModel(SettingsGeneral, 'SettingsGeneral', 'SETTINGS_LABELS/LABEL_GENERAL_NAME', 'general', true);
|
||||||
|
|
||||||
|
SettingsGeneral.prototype.toggleLayout = function ()
|
||||||
|
{
|
||||||
|
this.layout(Enums.Layout.NoPreview === this.layout() ? Enums.Layout.SidePreview : Enums.Layout.NoPreview);
|
||||||
|
};
|
||||||
|
|
||||||
SettingsGeneral.prototype.onBuild = function ()
|
SettingsGeneral.prototype.onBuild = function ()
|
||||||
{
|
{
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
@ -127,15 +132,6 @@ SettingsGeneral.prototype.onBuild = function ()
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
oData.usePreviewPane.subscribe(function (bValue) {
|
|
||||||
|
|
||||||
oData.messageList([]);
|
|
||||||
|
|
||||||
RL.remote().saveSettings(Utils.emptyFunction, {
|
|
||||||
'UsePreviewPane': bValue ? '1' : '0'
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
oData.layout.subscribe(function (nValue) {
|
oData.layout.subscribe(function (nValue) {
|
||||||
|
|
||||||
oData.messageList([]);
|
oData.messageList([]);
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ function AbstractData()
|
||||||
AbstractData.prototype.populateDataOnStart = function()
|
AbstractData.prototype.populateDataOnStart = function()
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
|
mLayout = Utils.pInt(RL.settingsGet('Layout')),
|
||||||
aLanguages = RL.settingsGet('Languages'),
|
aLanguages = RL.settingsGet('Languages'),
|
||||||
aThemes = RL.settingsGet('Themes')
|
aThemes = RL.settingsGet('Themes')
|
||||||
;
|
;
|
||||||
|
|
@ -48,10 +49,14 @@ AbstractData.prototype.populateDataOnStart = function()
|
||||||
this.desktopNotifications(!!RL.settingsGet('DesktopNotifications'));
|
this.desktopNotifications(!!RL.settingsGet('DesktopNotifications'));
|
||||||
this.useThreads(!!RL.settingsGet('UseThreads'));
|
this.useThreads(!!RL.settingsGet('UseThreads'));
|
||||||
this.replySameFolder(!!RL.settingsGet('ReplySameFolder'));
|
this.replySameFolder(!!RL.settingsGet('ReplySameFolder'));
|
||||||
this.usePreviewPane(!!RL.settingsGet('UsePreviewPane'));
|
|
||||||
this.layout(!!RL.settingsGet('UsePreviewPane') ? Enums.Layout.SidePreview : Enums.Layout.NoPreview); // TODO
|
|
||||||
this.useCheckboxesInList(!!RL.settingsGet('UseCheckboxesInList'));
|
this.useCheckboxesInList(!!RL.settingsGet('UseCheckboxesInList'));
|
||||||
|
|
||||||
|
this.layout(Enums.Layout.SidePreview);
|
||||||
|
if (-1 < Utils.inArray(mLayout, [Enums.Layout.NoPreview, Enums.Layout.SidePreview, Enums.Layout.BottomPreview]))
|
||||||
|
{
|
||||||
|
this.layout(mLayout);
|
||||||
|
}
|
||||||
|
|
||||||
this.facebookEnable(!!RL.settingsGet('AllowFacebookSocial'));
|
this.facebookEnable(!!RL.settingsGet('AllowFacebookSocial'));
|
||||||
this.facebookAppID(RL.settingsGet('FacebookAppID'));
|
this.facebookAppID(RL.settingsGet('FacebookAppID'));
|
||||||
this.facebookAppSecret(RL.settingsGet('FacebookAppSecret'));
|
this.facebookAppSecret(RL.settingsGet('FacebookAppSecret'));
|
||||||
|
|
|
||||||
|
|
@ -42,15 +42,19 @@ MailBoxFolderListViewModel.prototype.onBuild = function (oDom)
|
||||||
|
|
||||||
oEvent.preventDefault();
|
oEvent.preventDefault();
|
||||||
|
|
||||||
var oFolder = ko.dataFor(this);
|
var
|
||||||
|
oData = RL.data(),
|
||||||
|
oFolder = ko.dataFor(this)
|
||||||
|
;
|
||||||
|
|
||||||
if (oFolder)
|
if (oFolder)
|
||||||
{
|
{
|
||||||
if (!RL.data().usePreviewPane())
|
if (Enums.Layout.NoPreview === oData.layout())
|
||||||
{
|
{
|
||||||
RL.data().message(null);
|
oData.message(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oFolder.fullNameRaw === RL.data().currentFolderFullNameRaw())
|
if (oFolder.fullNameRaw === oData.currentFolderFullNameRaw())
|
||||||
{
|
{
|
||||||
RL.cache().setFolderHash(oFolder.fullNameRaw, '');
|
RL.cache().setFolderHash(oFolder.fullNameRaw, '');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ function MailBoxMessageViewViewModel()
|
||||||
this.useThreads = oData.useThreads;
|
this.useThreads = oData.useThreads;
|
||||||
this.replySameFolder = oData.replySameFolder;
|
this.replySameFolder = oData.replySameFolder;
|
||||||
this.layout = oData.layout;
|
this.layout = oData.layout;
|
||||||
|
this.usePreviewPane = oData.usePreviewPane;
|
||||||
this.isMessageSelected = oData.isMessageSelected;
|
this.isMessageSelected = oData.isMessageSelected;
|
||||||
this.messageActiveDom = oData.messageActiveDom;
|
this.messageActiveDom = oData.messageActiveDom;
|
||||||
this.messageError = oData.messageError;
|
this.messageError = oData.messageError;
|
||||||
|
|
|
||||||
|
|
@ -1104,7 +1104,7 @@ class Actions
|
||||||
$aResult['DesktopNotifications'] = false;
|
$aResult['DesktopNotifications'] = false;
|
||||||
$aResult['UseThreads'] = false;
|
$aResult['UseThreads'] = false;
|
||||||
$aResult['ReplySameFolder'] = false;
|
$aResult['ReplySameFolder'] = false;
|
||||||
$aResult['UsePreviewPane'] = (bool) $oConfig->Get('webmail', 'use_preview_pane', true);
|
$aResult['Layout'] = \RainLoop\Enumerations\Layout::SIDE_PREVIEW;
|
||||||
$aResult['UseCheckboxesInList'] = true;
|
$aResult['UseCheckboxesInList'] = true;
|
||||||
$aResult['DisplayName'] = '';
|
$aResult['DisplayName'] = '';
|
||||||
$aResult['ReplyTo'] = '';
|
$aResult['ReplyTo'] = '';
|
||||||
|
|
@ -1139,7 +1139,7 @@ class Actions
|
||||||
$aResult['DesktopNotifications'] = (bool) $oSettings->GetConf('DesktopNotifications', $aResult['DesktopNotifications']);
|
$aResult['DesktopNotifications'] = (bool) $oSettings->GetConf('DesktopNotifications', $aResult['DesktopNotifications']);
|
||||||
$aResult['UseThreads'] = (bool) $oSettings->GetConf('UseThreads', $aResult['UseThreads']);
|
$aResult['UseThreads'] = (bool) $oSettings->GetConf('UseThreads', $aResult['UseThreads']);
|
||||||
$aResult['ReplySameFolder'] = (bool) $oSettings->GetConf('ReplySameFolder', $aResult['ReplySameFolder']);
|
$aResult['ReplySameFolder'] = (bool) $oSettings->GetConf('ReplySameFolder', $aResult['ReplySameFolder']);
|
||||||
$aResult['UsePreviewPane'] = (bool) $oSettings->GetConf('UsePreviewPane', $aResult['UsePreviewPane']);
|
$aResult['Layout'] = (int) $oSettings->GetConf('Layout', $aResult['Layout']);
|
||||||
$aResult['UseCheckboxesInList'] = (bool) $oSettings->GetConf('UseCheckboxesInList', $aResult['UseCheckboxesInList']);
|
$aResult['UseCheckboxesInList'] = (bool) $oSettings->GetConf('UseCheckboxesInList', $aResult['UseCheckboxesInList']);
|
||||||
$aResult['InterfaceAnimation'] = (string) $oSettings->GetConf('InterfaceAnimation', $aResult['InterfaceAnimation']);
|
$aResult['InterfaceAnimation'] = (string) $oSettings->GetConf('InterfaceAnimation', $aResult['InterfaceAnimation']);
|
||||||
$aResult['CustomThemeType'] = (string) $oSettings->GetConf('CustomThemeType', $aResult['CustomThemeType']);
|
$aResult['CustomThemeType'] = (string) $oSettings->GetConf('CustomThemeType', $aResult['CustomThemeType']);
|
||||||
|
|
@ -3071,6 +3071,12 @@ class Actions
|
||||||
return (int) (\in_array($iValue, array(10, 20, 30, 50, 100, 150, 200, 300)) ? $iValue : 20);
|
return (int) (\in_array($iValue, array(10, 20, 30, 50, 100, 150, 200, 300)) ? $iValue : 20);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$this->setSettingsFromParams($oSettings, 'Layout', 'int', function ($iValue) {
|
||||||
|
return (int) (\in_array((int) $iValue, array(\RainLoop\Enumerations\Layout::NO_PREVIW,
|
||||||
|
\RainLoop\Enumerations\Layout::SIDE_PREVIEW, \RainLoop\Enumerations\Layout::BOTTOM_PREVIEW)) ?
|
||||||
|
$iValue : \RainLoop\Enumerations\Layout::SIDE_PREVIEW);
|
||||||
|
});
|
||||||
|
|
||||||
$this->setSettingsFromParams($oSettings, 'EditorDefaultType', 'string');
|
$this->setSettingsFromParams($oSettings, 'EditorDefaultType', 'string');
|
||||||
$this->setSettingsFromParams($oSettings, 'ShowImages', 'bool');
|
$this->setSettingsFromParams($oSettings, 'ShowImages', 'bool');
|
||||||
$this->setSettingsFromParams($oSettings, 'ContactsAutosave', 'bool');
|
$this->setSettingsFromParams($oSettings, 'ContactsAutosave', 'bool');
|
||||||
|
|
@ -3084,8 +3090,6 @@ class Actions
|
||||||
$this->setSettingsFromParams($oSettings, 'DesktopNotifications', 'bool');
|
$this->setSettingsFromParams($oSettings, 'DesktopNotifications', 'bool');
|
||||||
$this->setSettingsFromParams($oSettings, 'UseThreads', 'bool');
|
$this->setSettingsFromParams($oSettings, 'UseThreads', 'bool');
|
||||||
$this->setSettingsFromParams($oSettings, 'ReplySameFolder', 'bool');
|
$this->setSettingsFromParams($oSettings, 'ReplySameFolder', 'bool');
|
||||||
|
|
||||||
$this->setSettingsFromParams($oSettings, 'UsePreviewPane', 'bool');
|
|
||||||
$this->setSettingsFromParams($oSettings, 'UseCheckboxesInList', 'bool');
|
$this->setSettingsFromParams($oSettings, 'UseCheckboxesInList', 'bool');
|
||||||
|
|
||||||
$this->setSettingsFromParams($oSettings, 'DisplayName', 'string');
|
$this->setSettingsFromParams($oSettings, 'DisplayName', 'string');
|
||||||
|
|
|
||||||
|
|
@ -70,8 +70,6 @@ class Application extends \RainLoop\Config\AbstractConfig
|
||||||
'allow_additional_accounts' => array(true, ''),
|
'allow_additional_accounts' => array(true, ''),
|
||||||
'allow_identities' => array(true, ''),
|
'allow_identities' => array(true, ''),
|
||||||
|
|
||||||
'use_preview_pane' => array(true, 'Whether message preview pane should be used'),
|
|
||||||
|
|
||||||
'messages_per_page' => array(20, ' Number of messages displayed on page by default'),
|
'messages_per_page' => array(20, ' Number of messages displayed on page by default'),
|
||||||
|
|
||||||
'editor_default_type' => array('Html', 'Editor mode used by default (Html or Plain)'),
|
'editor_default_type' => array('Html', 'Editor mode used by default (Html or Plain)'),
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace RainLoop\Enumerations;
|
||||||
|
|
||||||
|
class Layout
|
||||||
|
{
|
||||||
|
const NO_PREVIW = 0;
|
||||||
|
const SIDE_PREVIEW = 1;
|
||||||
|
const BOTTOM_PREVIEW = 2;
|
||||||
|
}
|
||||||
|
|
@ -87,7 +87,7 @@
|
||||||
|
|
||||||
<span class="i18n" data-i18n-text="SETTINGS_GENERAL/LABEL_USE_CHECKBOXES_IN_LIST"></span>
|
<span class="i18n" data-i18n-text="SETTINGS_GENERAL/LABEL_USE_CHECKBOXES_IN_LIST"></span>
|
||||||
</label>
|
</label>
|
||||||
<label data-bind="click: function () { usePreviewPane(!usePreviewPane()); }">
|
<label data-bind="click: toggleLayout">
|
||||||
<i data-bind="css: usePreviewPane() ? 'icon-checkbox-checked' : 'icon-checkbox-unchecked'"></i>
|
<i data-bind="css: usePreviewPane() ? 'icon-checkbox-checked' : 'icon-checkbox-unchecked'"></i>
|
||||||
|
|
||||||
<span class="i18n" data-i18n-text="SETTINGS_GENERAL/LABEL_USE_PREVIEW_PANE"></span>
|
<span class="i18n" data-i18n-text="SETTINGS_GENERAL/LABEL_USE_PREVIEW_PANE"></span>
|
||||||
|
|
|
||||||
|
|
@ -1377,10 +1377,13 @@ Utils.initDataConstructorBySettings = function (oData)
|
||||||
oData.desktopNotifications = ko.observable(false);
|
oData.desktopNotifications = ko.observable(false);
|
||||||
oData.useThreads = ko.observable(true);
|
oData.useThreads = ko.observable(true);
|
||||||
oData.replySameFolder = ko.observable(true);
|
oData.replySameFolder = ko.observable(true);
|
||||||
oData.usePreviewPane = ko.observable(true);
|
|
||||||
oData.layout = ko.observable(Enums.Layout.SidePreview);
|
|
||||||
oData.useCheckboxesInList = ko.observable(true);
|
oData.useCheckboxesInList = ko.observable(true);
|
||||||
|
|
||||||
|
oData.layout = ko.observable(Enums.Layout.SidePreview);
|
||||||
|
oData.usePreviewPane = ko.computed(function () {
|
||||||
|
return Enums.Layout.NoPreview !== oData.layout();
|
||||||
|
});
|
||||||
|
|
||||||
oData.interfaceAnimation.subscribe(function (sValue) {
|
oData.interfaceAnimation.subscribe(function (sValue) {
|
||||||
if (Globals.bMobileDevice || sValue === Enums.InterfaceAnimation.None)
|
if (Globals.bMobileDevice || sValue === Enums.InterfaceAnimation.None)
|
||||||
{
|
{
|
||||||
|
|
@ -6257,6 +6260,7 @@ function AbstractData()
|
||||||
AbstractData.prototype.populateDataOnStart = function()
|
AbstractData.prototype.populateDataOnStart = function()
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
|
mLayout = Utils.pInt(RL.settingsGet('Layout')),
|
||||||
aLanguages = RL.settingsGet('Languages'),
|
aLanguages = RL.settingsGet('Languages'),
|
||||||
aThemes = RL.settingsGet('Themes')
|
aThemes = RL.settingsGet('Themes')
|
||||||
;
|
;
|
||||||
|
|
@ -6294,10 +6298,14 @@ AbstractData.prototype.populateDataOnStart = function()
|
||||||
this.desktopNotifications(!!RL.settingsGet('DesktopNotifications'));
|
this.desktopNotifications(!!RL.settingsGet('DesktopNotifications'));
|
||||||
this.useThreads(!!RL.settingsGet('UseThreads'));
|
this.useThreads(!!RL.settingsGet('UseThreads'));
|
||||||
this.replySameFolder(!!RL.settingsGet('ReplySameFolder'));
|
this.replySameFolder(!!RL.settingsGet('ReplySameFolder'));
|
||||||
this.usePreviewPane(!!RL.settingsGet('UsePreviewPane'));
|
|
||||||
this.layout(!!RL.settingsGet('UsePreviewPane') ? Enums.Layout.SidePreview : Enums.Layout.NoPreview); // TODO
|
|
||||||
this.useCheckboxesInList(!!RL.settingsGet('UseCheckboxesInList'));
|
this.useCheckboxesInList(!!RL.settingsGet('UseCheckboxesInList'));
|
||||||
|
|
||||||
|
this.layout(Enums.Layout.SidePreview);
|
||||||
|
if (-1 < Utils.inArray(mLayout, [Enums.Layout.NoPreview, Enums.Layout.SidePreview, Enums.Layout.BottomPreview]))
|
||||||
|
{
|
||||||
|
this.layout(mLayout);
|
||||||
|
}
|
||||||
|
|
||||||
this.facebookEnable(!!RL.settingsGet('AllowFacebookSocial'));
|
this.facebookEnable(!!RL.settingsGet('AllowFacebookSocial'));
|
||||||
this.facebookAppID(RL.settingsGet('FacebookAppID'));
|
this.facebookAppID(RL.settingsGet('FacebookAppID'));
|
||||||
this.facebookAppSecret(RL.settingsGet('FacebookAppSecret'));
|
this.facebookAppSecret(RL.settingsGet('FacebookAppSecret'));
|
||||||
|
|
|
||||||
6
rainloop/v/0.0.0/static/js/admin.min.js
vendored
6
rainloop/v/0.0.0/static/js/admin.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -1377,10 +1377,13 @@ Utils.initDataConstructorBySettings = function (oData)
|
||||||
oData.desktopNotifications = ko.observable(false);
|
oData.desktopNotifications = ko.observable(false);
|
||||||
oData.useThreads = ko.observable(true);
|
oData.useThreads = ko.observable(true);
|
||||||
oData.replySameFolder = ko.observable(true);
|
oData.replySameFolder = ko.observable(true);
|
||||||
oData.usePreviewPane = ko.observable(true);
|
|
||||||
oData.layout = ko.observable(Enums.Layout.SidePreview);
|
|
||||||
oData.useCheckboxesInList = ko.observable(true);
|
oData.useCheckboxesInList = ko.observable(true);
|
||||||
|
|
||||||
|
oData.layout = ko.observable(Enums.Layout.SidePreview);
|
||||||
|
oData.usePreviewPane = ko.computed(function () {
|
||||||
|
return Enums.Layout.NoPreview !== oData.layout();
|
||||||
|
});
|
||||||
|
|
||||||
oData.interfaceAnimation.subscribe(function (sValue) {
|
oData.interfaceAnimation.subscribe(function (sValue) {
|
||||||
if (Globals.bMobileDevice || sValue === Enums.InterfaceAnimation.None)
|
if (Globals.bMobileDevice || sValue === Enums.InterfaceAnimation.None)
|
||||||
{
|
{
|
||||||
|
|
@ -11246,15 +11249,19 @@ MailBoxFolderListViewModel.prototype.onBuild = function (oDom)
|
||||||
|
|
||||||
oEvent.preventDefault();
|
oEvent.preventDefault();
|
||||||
|
|
||||||
var oFolder = ko.dataFor(this);
|
var
|
||||||
|
oData = RL.data(),
|
||||||
|
oFolder = ko.dataFor(this)
|
||||||
|
;
|
||||||
|
|
||||||
if (oFolder)
|
if (oFolder)
|
||||||
{
|
{
|
||||||
if (!RL.data().usePreviewPane())
|
if (Enums.Layout.NoPreview === oData.layout())
|
||||||
{
|
{
|
||||||
RL.data().message(null);
|
oData.message(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oFolder.fullNameRaw === RL.data().currentFolderFullNameRaw())
|
if (oFolder.fullNameRaw === oData.currentFolderFullNameRaw())
|
||||||
{
|
{
|
||||||
RL.cache().setFolderHash(oFolder.fullNameRaw, '');
|
RL.cache().setFolderHash(oFolder.fullNameRaw, '');
|
||||||
}
|
}
|
||||||
|
|
@ -12266,6 +12273,7 @@ function MailBoxMessageViewViewModel()
|
||||||
this.useThreads = oData.useThreads;
|
this.useThreads = oData.useThreads;
|
||||||
this.replySameFolder = oData.replySameFolder;
|
this.replySameFolder = oData.replySameFolder;
|
||||||
this.layout = oData.layout;
|
this.layout = oData.layout;
|
||||||
|
this.usePreviewPane = oData.usePreviewPane;
|
||||||
this.isMessageSelected = oData.isMessageSelected;
|
this.isMessageSelected = oData.isMessageSelected;
|
||||||
this.messageActiveDom = oData.messageActiveDom;
|
this.messageActiveDom = oData.messageActiveDom;
|
||||||
this.messageError = oData.messageError;
|
this.messageError = oData.messageError;
|
||||||
|
|
@ -12693,8 +12701,8 @@ function SettingsGeneral()
|
||||||
this.threading = oData.threading;
|
this.threading = oData.threading;
|
||||||
this.useThreads = oData.useThreads;
|
this.useThreads = oData.useThreads;
|
||||||
this.replySameFolder = oData.replySameFolder;
|
this.replySameFolder = oData.replySameFolder;
|
||||||
this.usePreviewPane = oData.usePreviewPane;
|
|
||||||
this.layout = oData.layout;
|
this.layout = oData.layout;
|
||||||
|
this.usePreviewPane = oData.usePreviewPane;
|
||||||
this.useCheckboxesInList = oData.useCheckboxesInList;
|
this.useCheckboxesInList = oData.useCheckboxesInList;
|
||||||
this.allowLanguagesOnSettings = oData.allowLanguagesOnSettings;
|
this.allowLanguagesOnSettings = oData.allowLanguagesOnSettings;
|
||||||
|
|
||||||
|
|
@ -12719,6 +12727,11 @@ function SettingsGeneral()
|
||||||
|
|
||||||
Utils.addSettingsViewModel(SettingsGeneral, 'SettingsGeneral', 'SETTINGS_LABELS/LABEL_GENERAL_NAME', 'general', true);
|
Utils.addSettingsViewModel(SettingsGeneral, 'SettingsGeneral', 'SETTINGS_LABELS/LABEL_GENERAL_NAME', 'general', true);
|
||||||
|
|
||||||
|
SettingsGeneral.prototype.toggleLayout = function ()
|
||||||
|
{
|
||||||
|
this.layout(Enums.Layout.NoPreview === this.layout() ? Enums.Layout.SidePreview : Enums.Layout.NoPreview);
|
||||||
|
};
|
||||||
|
|
||||||
SettingsGeneral.prototype.onBuild = function ()
|
SettingsGeneral.prototype.onBuild = function ()
|
||||||
{
|
{
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
@ -12803,15 +12816,6 @@ SettingsGeneral.prototype.onBuild = function ()
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
oData.usePreviewPane.subscribe(function (bValue) {
|
|
||||||
|
|
||||||
oData.messageList([]);
|
|
||||||
|
|
||||||
RL.remote().saveSettings(Utils.emptyFunction, {
|
|
||||||
'UsePreviewPane': bValue ? '1' : '0'
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
oData.layout.subscribe(function (nValue) {
|
oData.layout.subscribe(function (nValue) {
|
||||||
|
|
||||||
oData.messageList([]);
|
oData.messageList([]);
|
||||||
|
|
@ -13684,6 +13688,7 @@ function AbstractData()
|
||||||
AbstractData.prototype.populateDataOnStart = function()
|
AbstractData.prototype.populateDataOnStart = function()
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
|
mLayout = Utils.pInt(RL.settingsGet('Layout')),
|
||||||
aLanguages = RL.settingsGet('Languages'),
|
aLanguages = RL.settingsGet('Languages'),
|
||||||
aThemes = RL.settingsGet('Themes')
|
aThemes = RL.settingsGet('Themes')
|
||||||
;
|
;
|
||||||
|
|
@ -13721,10 +13726,14 @@ AbstractData.prototype.populateDataOnStart = function()
|
||||||
this.desktopNotifications(!!RL.settingsGet('DesktopNotifications'));
|
this.desktopNotifications(!!RL.settingsGet('DesktopNotifications'));
|
||||||
this.useThreads(!!RL.settingsGet('UseThreads'));
|
this.useThreads(!!RL.settingsGet('UseThreads'));
|
||||||
this.replySameFolder(!!RL.settingsGet('ReplySameFolder'));
|
this.replySameFolder(!!RL.settingsGet('ReplySameFolder'));
|
||||||
this.usePreviewPane(!!RL.settingsGet('UsePreviewPane'));
|
|
||||||
this.layout(!!RL.settingsGet('UsePreviewPane') ? Enums.Layout.SidePreview : Enums.Layout.NoPreview); // TODO
|
|
||||||
this.useCheckboxesInList(!!RL.settingsGet('UseCheckboxesInList'));
|
this.useCheckboxesInList(!!RL.settingsGet('UseCheckboxesInList'));
|
||||||
|
|
||||||
|
this.layout(Enums.Layout.SidePreview);
|
||||||
|
if (-1 < Utils.inArray(mLayout, [Enums.Layout.NoPreview, Enums.Layout.SidePreview, Enums.Layout.BottomPreview]))
|
||||||
|
{
|
||||||
|
this.layout(mLayout);
|
||||||
|
}
|
||||||
|
|
||||||
this.facebookEnable(!!RL.settingsGet('AllowFacebookSocial'));
|
this.facebookEnable(!!RL.settingsGet('AllowFacebookSocial'));
|
||||||
this.facebookAppID(RL.settingsGet('FacebookAppID'));
|
this.facebookAppID(RL.settingsGet('FacebookAppID'));
|
||||||
this.facebookAppSecret(RL.settingsGet('FacebookAppSecret'));
|
this.facebookAppSecret(RL.settingsGet('FacebookAppSecret'));
|
||||||
|
|
@ -16364,7 +16373,7 @@ MailBoxScreen.prototype.onRoute = function (sFolderHash, iPage, sSearch, bPrevie
|
||||||
{
|
{
|
||||||
if (Utils.isUnd(bPreview) ? false : !!bPreview)
|
if (Utils.isUnd(bPreview) ? false : !!bPreview)
|
||||||
{
|
{
|
||||||
if (!RL.data().usePreviewPane() && !RL.data().message())
|
if (Enums.Layout.NoPreview === RL.data().layout() && !RL.data().message())
|
||||||
{
|
{
|
||||||
RL.historyBack();
|
RL.historyBack();
|
||||||
}
|
}
|
||||||
|
|
@ -16385,7 +16394,7 @@ MailBoxScreen.prototype.onRoute = function (sFolderHash, iPage, sSearch, bPrevie
|
||||||
.messageListSearch(sSearch)
|
.messageListSearch(sSearch)
|
||||||
;
|
;
|
||||||
|
|
||||||
if (!oData.usePreviewPane() && oData.message())
|
if (Enums.Layout.NoPreview === oData.layout() && oData.message())
|
||||||
{
|
{
|
||||||
oData.message(null);
|
oData.message(null);
|
||||||
oData.messageFullScreenMode(false);
|
oData.messageFullScreenMode(false);
|
||||||
|
|
@ -16425,14 +16434,14 @@ MailBoxScreen.prototype.onStart = function ()
|
||||||
RL.remote().appDelayStart(Utils.emptyFunction);
|
RL.remote().appDelayStart(Utils.emptyFunction);
|
||||||
}, 35000);
|
}, 35000);
|
||||||
|
|
||||||
$html.toggleClass('rl-no-preview-pane', !oData.usePreviewPane());
|
$html.toggleClass('rl-no-preview-pane', Enums.Layout.NoPreview === oData.layout());
|
||||||
|
|
||||||
oData.folderList.subscribe(fResizeFunction);
|
oData.folderList.subscribe(fResizeFunction);
|
||||||
oData.messageList.subscribe(fResizeFunction);
|
oData.messageList.subscribe(fResizeFunction);
|
||||||
oData.message.subscribe(fResizeFunction);
|
oData.message.subscribe(fResizeFunction);
|
||||||
|
|
||||||
oData.usePreviewPane.subscribe(function (bValue) {
|
oData.layout.subscribe(function (nValue) {
|
||||||
$html.toggleClass('rl-no-preview-pane', !bValue);
|
$html.toggleClass('rl-no-preview-pane', Enums.Layout.NoPreview === nValue);
|
||||||
});
|
});
|
||||||
|
|
||||||
oData.foldersInboxUnreadCount.subscribe(function () {
|
oData.foldersInboxUnreadCount.subscribe(function () {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue