create compose service

pull/3/head
alex 9 years ago
parent 077c2765c0
commit 306dbec2fb

@ -9,7 +9,7 @@
.controller('MailCtrl', MailCtrl);
/** @ngInject */
function MailCtrl($scope, $location, $sce) {
function MailCtrl($scope, $location, $sce, composeModal) {
$scope.showMail = false;
@ -315,6 +315,13 @@
$scope.tab = findTabByLabel(0);
$scope.currentMessages = $scope.tabs[$scope.tab].filter($scope.messages);
$scope.mail = $scope.currentMessages[findMessageById(0)];
$scope.showCompose = function(){
composeModal.open({
subject : "hello world"
})
}
}
})();

@ -2,7 +2,7 @@
<div class="row letter-layout">
<div class="mail-navigation-container">
<div class="compose-button">
<button type="button" class="btn compose-button">
<button type="button" class="btn compose-button" ng-click="showCompose()">
Compose
</button>
</div>

@ -0,0 +1 @@
<h1>Subject:{{subject}}</h1>

@ -0,0 +1,21 @@
/**
* @author a.demeshko
* created on 24/12/15
*/
(function () {
'use strict';
angular.module('BlurAdmin.theme.components')
.controller('composeBoxCtrl', composeBoxCtrl);
/** @ngInject */
function composeBoxCtrl($scope, $uibModalInstance) {
$scope.ok = function () {
$uibModalInstance.close($scope.selected.item);
};
$scope.cancel = function () {
$uibModalInstance.dismiss('cancel');
};
}
})();

@ -0,0 +1,28 @@
/**
* @author a.demeshko
* created on 12/24/15
*/
(function () {
'use strict';
angular.module('BlurAdmin.theme')
.service('composeModal', composeModal);
/** @ngInject */
function composeModal($uibModal) {
return {
open : function(options){
return $uibModal.open({
animation: false,
templateUrl: 'app/theme/components/composeBox/compose.html',
controller: 'composeBoxCtrl',
size: size,
resolve: {
subject : options.subject
}
});
}
}
}
})();
Loading…
Cancel
Save