Keyboard shortcuts optimizations (#70, #109)

This commit is contained in:
RainLoop Team 2014-04-08 23:22:17 +04:00
parent 0b30bac43f
commit 05f455c34e
17 changed files with 400 additions and 264 deletions

View file

@ -196,16 +196,21 @@ function MailBoxMessageListViewModel()
'.messageListItem .actionHandle', '.messageListItem.selected', '.messageListItem .checkboxMessage',
'.messageListItem.focused');
this.selector.on('onItemSelect', _.bind(function (oMessage) {
this.selector.on('onItemSelect', _.bind(function (oMessage, bClick) {
if (oMessage)
{
oData.message(oData.staticMessageList.populateByMessageListItem(oMessage));
this.populateMessageBody(oData.message());
if (Enums.Layout.NoPreview === oData.layout())
{
kn.setHash(RL.link().messagePreview(), true);
oData.message.focused(true);
}
else if (bClick)
{
oData.message.focused(false);
}
oData.message(oData.staticMessageList.populateByMessageListItem(oMessage));
this.populateMessageBody(oData.message());
}
else
{
@ -226,10 +231,10 @@ function MailBoxMessageListViewModel()
RL
.sub('mailbox.message-list.selector.go-down', function () {
this.selector.goDown();
this.selector.goDown(true);
}, this)
.sub('mailbox.message-list.selector.go-up', function () {
this.selector.goUp();
this.selector.goUp(true);
}, this)
;
@ -696,7 +701,7 @@ MailBoxMessageListViewModel.prototype.initShortcuts = function ()
});
// change focused state
key('tab', Enums.KeyState.MessageList, function () {
key('tab, shift+tab', Enums.KeyState.MessageList, function () {
if (oData.useKeyboardShortcuts())
{
if (self.message())