This commit is contained in:
Henry
2015-10-09 15:27:40 -07:00
parent 82ae9e72c1
commit 60dda8a7a4
10 changed files with 101 additions and 53 deletions

View File

@@ -104,7 +104,7 @@
{
"key": "BannerController",
"implementation": "controllers/BannerController.js",
"depends": ["$scope", "notificationService"]
"depends": ["$scope", "notificationService", "dialogService"]
}
],
"directives": [

View File

@@ -1,20 +1,18 @@
<div ng-controller="BannerController">
<div ng-show="active.notification"
class="l-message-banner s-message-banner">
<span class="banner-elem label">
{{active.notification.title}}
</span>
<span ng-hide="active.notification.progress === undefined">
<mct-include key="'progress-bar'" class="banner-elem"
ng-model="ngModel">
</mct-include>
</span>
<a ng-hide="active.notification.primaryAction === undefined"
class="banner-elem l-action s-action"
ng-click="active.notification.primaryAction.action">
{{active.notification.primaryAction.label}}
</a>
<a class="banner-elem ui-symbol close" ng-click="dismiss(active.notification)">
&#x78;</a>
</div>
<div ng-controller="BannerController" ng-show="active.notification"
class="l-message-banner s-message-banner" ng-click="maximize(active.notification)">
<span class="banner-elem label">
{{active.notification.title}}
</span>
<span ng-hide="active.notification.progress === undefined">
<mct-include key="'progress-bar'" class="banner-elem"
ng-model="active.notification">
</mct-include>
</span>
<a ng-hide="active.notification.primaryAction === undefined"
class="banner-elem l-action s-action"
ng-click="active.notification.primaryAction.action()">
{{active.notification.primaryAction.label}}
</a>
<a class="banner-elem ui-symbol close" ng-click="dismiss(active.notification)">
&#x78;</a>
</div>

View File

@@ -25,10 +25,16 @@ define(
[],
function () {
"use strict";
function BannerController($scope, notificationService){
function BannerController($scope, notificationService, dialogService) {
$scope.active = notificationService.active;
$scope.dismiss = function(notification){
$scope.dismiss = function(notification) {
notificationService.dismissOrMinimize(notification);
};
$scope.maximize = function(notification) {
notification.cancel = function(){
dialogService.dismiss();
}
dialogService.showBlockingMessage(notification);
}
}
return BannerController;