mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-06-24 03:14:17 +00:00
(js) Add hotkey to search in contacts
This commit is contained in:
@@ -227,7 +227,7 @@
|
||||
<!-- sort mode (default) -->
|
||||
<div class="md-toolbar-tools" ng-hide="addressbook.mode.search">
|
||||
<md-button class="sg-icon-button" label:aria-label="Search"
|
||||
ng-click="addressbook.mode.search = true">
|
||||
ng-click="addressbook.searchMode()">
|
||||
<md-icon>search</md-icon>
|
||||
</md-button>
|
||||
<a href="javascript:void(0)" class="sg-folder-name"
|
||||
@@ -309,7 +309,7 @@
|
||||
<md-icon>arrow_back</md-icon>
|
||||
</md-button>
|
||||
<md-input-container class="md-flex" md-no-float="md-no-float">
|
||||
<input name="folderSearch" type="search" var:minlength="minimumSearchLength" label:placeholder="Search"/>
|
||||
<input name="folderSearch" type="search" var:minlength="minimumSearchLength" label:placeholder="Search" sg-focus-on="search"/>
|
||||
<div ng-messages="searchForm.folderSearch.$error" ng-show="searchForm.folderSearch.$dirty">
|
||||
<div ng-message="minlength"><var:string value="minimumSearchLengthLabel"/></div>
|
||||
</div>
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
/**
|
||||
* @ngInject
|
||||
*/
|
||||
AddressBookController.$inject = ['$scope', '$q', '$window', '$state', '$timeout', '$mdDialog', '$mdToast', 'Account', 'Card', 'AddressBook', 'Dialog', 'sgSettings', 'sgHotkeys', 'stateAddressbooks', 'stateAddressbook'];
|
||||
function AddressBookController($scope, $q, $window, $state, $timeout, $mdDialog, $mdToast, Account, Card, AddressBook, Dialog, Settings, sgHotkeys, stateAddressbooks, stateAddressbook) {
|
||||
AddressBookController.$inject = ['$scope', '$q', '$window', '$state', '$timeout', '$mdDialog', '$mdToast', 'Account', 'Card', 'AddressBook', 'sgFocus', 'Dialog', 'sgSettings', 'sgHotkeys', 'stateAddressbooks', 'stateAddressbook'];
|
||||
function AddressBookController($scope, $q, $window, $state, $timeout, $mdDialog, $mdToast, Account, Card, AddressBook, focus, Dialog, Settings, sgHotkeys, stateAddressbooks, stateAddressbook) {
|
||||
var vm = this, hotkeys = [];
|
||||
|
||||
AddressBook.selectedFolder = stateAddressbook;
|
||||
@@ -24,6 +24,7 @@
|
||||
vm.selectAll = selectAll;
|
||||
vm.sort = sort;
|
||||
vm.sortedBy = sortedBy;
|
||||
vm.searchMode = searchMode;
|
||||
vm.cancelSearch = cancelSearch;
|
||||
vm.newMessage = newMessage;
|
||||
vm.newMessageWithSelectedCards = newMessageWithSelectedCards;
|
||||
@@ -42,6 +43,11 @@
|
||||
|
||||
|
||||
function _registerHotkeys(keys) {
|
||||
keys.push(sgHotkeys.createHotkey({
|
||||
key: l('hotkey_search'),
|
||||
description: l('Search'),
|
||||
callback: searchMode
|
||||
}));
|
||||
keys.push(sgHotkeys.createHotkey({
|
||||
key: l('key_create_card'),
|
||||
description: l('Create a new address book card'),
|
||||
@@ -270,6 +276,11 @@
|
||||
return AddressBook.$query.sort == field;
|
||||
}
|
||||
|
||||
function searchMode() {
|
||||
vm.mode.search = true;
|
||||
focus('search');
|
||||
}
|
||||
|
||||
function cancelSearch() {
|
||||
vm.mode.search = false;
|
||||
vm.selectedFolder.$filter('');
|
||||
|
||||
Reference in New Issue
Block a user