Skip to content

Commit bb58f42

Browse files
committed
Modify demo to re-add notification after it has been dismissed.
1 parent d2aa17d commit bb58f42

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

src/notification/inline-notification.component.js

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,23 +68,30 @@
6868
</file>
6969
7070
<file name="script.js">
71-
angular.module( 'patternfly.notification' ).controller( 'NotificationDemoCtrl', function( $scope, Notifications, $rootScope ) {
71+
angular.module( 'patternfly.notification' ).controller( 'NotificationDemoCtrl', function( $scope, $timeout ) {
7272
$scope.types = ['success','info','danger', 'warning'];
73-
$scope.notifications = $rootScope.notifications;
74-
$scope.notification = {
75-
type: $scope.types[0],
76-
isPersistent: false,
77-
header: 'Default Header.',
78-
message: 'Default Message.'
79-
}
8073
8174
$scope.updateType = function(item) {
8275
$scope.notification.type = item;
8376
};
8477
8578
$scope.removeNotification = function () {
86-
$scope.notification = null;
79+
$scope.notification = undefined;
80+
// Add notification back for demo purposes
81+
$timeout(function() {
82+
createNotification();
83+
}, 1000);
8784
};
85+
86+
var createNotification = function () {
87+
$scope.notification = {
88+
type: $scope.types[0],
89+
isPersistent: false,
90+
header: 'Default Header.',
91+
message: 'Default Message.'
92+
};
93+
};
94+
createNotification();
8895
});
8996
</file>
9097

0 commit comments

Comments
 (0)