Added keyboard shortcuts (part 1) (#70)

Scrolling in message view (#109)
This commit is contained in:
RainLoop Team 2014-04-08 01:03:58 +04:00
parent 3936a818b7
commit 8979687f88
37 changed files with 2095 additions and 333 deletions

View file

@ -171,10 +171,6 @@ function PopupsContactsViewModel()
return oContact ? oContact.generateUid() : '';
});
this.selector.on('onDelete', _.bind(function () {
this.deleteCommand();
}, this));
this.newCommand = Utils.createCommand(this, function () {
this.populateViewContact(null);
this.currentContact(null);
@ -307,6 +303,8 @@ function PopupsContactsViewModel()
}
}, this);
this.sKeyScope = Enums.KeyState.MessageList;
Knoin.constructorEnd(this);
}
@ -577,10 +575,18 @@ PopupsContactsViewModel.prototype.onBuild = function (oDom)
this.oContentVisible = $('.b-list-content', oDom);
this.oContentScrollable = $('.content', this.oContentVisible);
this.selector.init(this.oContentVisible, this.oContentScrollable);
this.selector.init(this.oContentVisible, this.oContentScrollable, Enums.KeyState.ContactList);
var self = this;
key('delete', Enums.KeyState.ContactList, function () {
if (RL.data().useKeyboardShortcuts())
{
self.deleteCommand();
return false;
}
});
ko.computed(function () {
var
bModalVisibility = this.modalVisibility(),
@ -607,6 +613,9 @@ PopupsContactsViewModel.prototype.onShow = function ()
{
kn.routeOff();
this.reloadContactList(true);
this.sKeyScope = RL.data().keyScope();
RL.data().keyScope(Enums.KeyState.ContactList);
};
PopupsContactsViewModel.prototype.onHide = function ()
@ -619,4 +628,6 @@ PopupsContactsViewModel.prototype.onHide = function ()
_.each(this.contacts(), function (oItem) {
oItem.checked(false);
});
RL.data().keyScope(this.sKeyScope);
};