GUAC-928: Add progress bar to notifications.

This commit is contained in:
Michael Jumper committed 2014-12-05 10:47:22 -08:00
1 parent 4636a1994a
commit 6c96affbd8
6 files changed
+60 -3

No files matched your search

@@ -108,6 +108,15 @@ angular.module('notification').directive('guacNotification', [function guacNotif
*/
progress : '=',
/**
* Value between 0 and 1 denoting what proportion of the operation
* has completed. If known, this value should be 0 if the operation
* has not started, and 1 if the operation is complete.
*
* @type Number
*/
progressRatio : '=',
/**
* Array of name/callback pairs for each action the user is allowed
* to take once the notification is shown.
@@ -132,6 +141,11 @@ angular.module('notification').directive('guacNotification', [function guacNotif
templateUrl: 'app/notification/templates/guacNotification.html',
controller: ['$scope', '$interval', function guacNotificationController($scope, $interval) {
// Update progress bar if end known
$scope.$watch("progressRatio", function updateProgress(ratio) {
$scope.progressPercent = ratio * 100;
});
// Set countdown interval when associated property is set
$scope.$watch("countdown", function resetTimeRemaining(countdown) {