mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-29 00:39:28 +00:00
(js) New file structure for Angular modules
JavaScript files are now merged by the 'js' Grunt task.
This commit is contained in:
56
UI/WebServerResources/js/Contacts/AddressBookController.js
Normal file
56
UI/WebServerResources/js/Contacts/AddressBookController.js
Normal file
@@ -0,0 +1,56 @@
|
||||
/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* @ngInject
|
||||
*/
|
||||
AddressBookController.$inject = ['$state', '$scope', '$rootScope', '$stateParams', '$timeout', '$mdDialog', 'sgFocus', 'Card', 'AddressBook', 'Dialog', 'sgSettings', 'stateAddressbooks', 'stateAddressbook'];
|
||||
function AddressBookController($state, $scope, $rootScope, $stateParams, $timeout, $mdDialog, focus, Card, AddressBook, Dialog, Settings, stateAddressbooks, stateAddressbook) {
|
||||
var currentAddressbook;
|
||||
|
||||
$rootScope.currentFolder = stateAddressbook;
|
||||
|
||||
$scope.newComponent = function(ev) {
|
||||
$mdDialog.show({
|
||||
parent: angular.element(document.body),
|
||||
targetEvent: ev,
|
||||
clickOutsideToClose: true,
|
||||
escapeToClose: true,
|
||||
template: [
|
||||
'<md-dialog aria-label="Create component">',
|
||||
' <md-content>',
|
||||
' <div layout="column">',
|
||||
' <md-button ng-click="createContact()">',
|
||||
' ' + l('Contact'),
|
||||
' </md-button>',
|
||||
' <md-button ng-click="createList()">',
|
||||
' ' + l('List'),
|
||||
' </md-button>',
|
||||
' </div>',
|
||||
' </md-content>',
|
||||
'</md-dialog>'
|
||||
].join(''),
|
||||
locals: {
|
||||
state: $state
|
||||
},
|
||||
controller: ComponentDialogController
|
||||
});
|
||||
function ComponentDialogController(scope, $mdDialog, state) {
|
||||
scope.createContact = function() {
|
||||
state.go('app.addressbook.new', { addressbookId: $scope.currentFolder.id, contactType: 'card' });
|
||||
$mdDialog.hide();
|
||||
}
|
||||
scope.createList = function() {
|
||||
state.go('app.addressbook.new', { addressbookId: $scope.currentFolder.id, contactType: 'list' });
|
||||
$mdDialog.hide();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
angular
|
||||
.module('SOGo.ContactsUI')
|
||||
.controller('AddressBookController', AddressBookController);
|
||||
})();
|
||||
Reference in New Issue
Block a user