Capability improvements

Additional branding options
This commit is contained in:
RainLoop Team 2015-05-20 02:05:54 +04:00
parent 7fce424758
commit 763fae345b
46 changed files with 880 additions and 556 deletions

View file

@ -89,6 +89,7 @@
this.resizerTrigger = _.bind(this.resizerTrigger, this);
this.allowContacts = !!AppStore.contactsIsAllowed();
this.allowFolders = !!Settings.capa(Enums.Capa.Folders);
this.bSkipNextHide = false;
this.composeInEdit = AppStore.composeInEdit;
@ -321,7 +322,7 @@
}
}, this));
this.canBeSendedOrSaved = ko.computed(function () {
this.canBeSentOrSaved = ko.computed(function () {
return !this.sending() && !this.saving();
}, this);
@ -375,6 +376,11 @@
}
}
if (!this.allowFolders)
{
sSentFolder = Consts.Values.UnuseOptionValue;
}
if ('' === sSentFolder)
{
kn.showScreenPopup(require('View/Popup/FolderSystem'), [Enums.SetSystemFoldersNotification.Sent]);
@ -432,10 +438,16 @@
);
}
}
}, this.canBeSendedOrSaved);
}, this.canBeSentOrSaved);
this.saveCommand = Utils.createCommand(this, function () {
if (!this.allowFolders)
{
return false;
}
if (FolderStore.draftFolderNotEnabled())
{
kn.showScreenPopup(require('View/Popup/FolderSystem'), [Enums.SetSystemFoldersNotification.Draft]);
@ -470,7 +482,7 @@
);
}
}, this.canBeSendedOrSaved);
}, this.canBeSentOrSaved);
this.skipCommand = Utils.createCommand(this, function () {
@ -484,7 +496,7 @@
this.tryToClosePopup();
}, this.canBeSendedOrSaved);
}, this.canBeSentOrSaved);
this.contactsCommand = Utils.createCommand(this, function () {
@ -635,7 +647,7 @@
sDraftFolder = FolderStore.draftFolder()
;
if ('' !== sDraftFolder)
if ('' !== sDraftFolder && Consts.Values.UnuseOptionValue !== sDraftFolder)
{
Cache.setFolderHash(sDraftFolder, '');
if (FolderStore.currentFolderFullNameRaw() === sDraftFolder)
@ -1413,10 +1425,13 @@
return false;
});
key('ctrl+s, command+s', Enums.KeyState.Compose, function () {
self.saveCommand();
return false;
});
if (this.allowFolders)
{
key('ctrl+s, command+s', Enums.KeyState.Compose, function () {
self.saveCommand();
return false;
});
}
if (!!Settings.settingsGet('AllowCtrlEnterOnCompose'))
{

View file

@ -21,6 +21,8 @@
SettingsStore = require('Stores/User/Settings'),
ContactStore = require('Stores/User/Contact'),
Settings = require('Storage/Settings'),
Remote = require('Remote/User/Ajax'),
EmailModel = require('Model/Email'),
@ -237,6 +239,12 @@
});
this.newMessageCommand = Utils.createCommand(this, function () {
if (!Settings.capa(Enums.Capa.Composer))
{
return false;
}
var
aE = [],
aC = this.contactsCheckedOrSelected(),
@ -772,7 +780,10 @@
{
this.bBackToCompose = false;
kn.showScreenPopup(require('View/Popup/Compose'));
if (Settings.capa(Enums.Capa.Composer))
{
kn.showScreenPopup(require('View/Popup/Compose'));
}
}
};