mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-10 15:58:52 +00:00
(js) Use a speed dial for card/list creation
This commit is contained in:
@@ -40,42 +40,8 @@
|
||||
$event.stopPropagation();
|
||||
}
|
||||
|
||||
function newComponent(ev) {
|
||||
$mdDialog.show({
|
||||
parent: angular.element(document.body),
|
||||
targetEvent: ev,
|
||||
clickOutsideToClose: true,
|
||||
escapeToClose: true,
|
||||
template: [
|
||||
'<md-dialog aria-label="' + l('Create component') + '">',
|
||||
' <md-dialog-content>',
|
||||
' <div layout="column">',
|
||||
' <md-button ng-click="create(\'card\')">',
|
||||
' ' + l('Contact'),
|
||||
' </md-button>',
|
||||
' <md-button ng-click="create(\'list\')">',
|
||||
' ' + l('List'),
|
||||
' </md-button>',
|
||||
' </div>',
|
||||
' </md-dialog-content>',
|
||||
'</md-dialog>'
|
||||
].join(''),
|
||||
locals: {
|
||||
addressbookId: vm.selectedFolder.id
|
||||
},
|
||||
controller: ComponentDialogController
|
||||
});
|
||||
|
||||
/**
|
||||
* @ngInject
|
||||
*/
|
||||
ComponentDialogController.$inject = ['scope', '$mdDialog', '$state', 'addressbookId'];
|
||||
function ComponentDialogController(scope, $mdDialog, $state, addressbookId) {
|
||||
scope.create = function(type) {
|
||||
$mdDialog.hide();
|
||||
$state.go('app.addressbook.new', { addressbookId: addressbookId, contactType: type });
|
||||
};
|
||||
}
|
||||
function newComponent(type) {
|
||||
$state.go('app.addressbook.new', { contactType: type });
|
||||
}
|
||||
|
||||
function unselectCards() {
|
||||
|
||||
Reference in New Issue
Block a user