Change alert to be floating notifications popup on the top right of the screen. (Nota: i disabled the last error staying open until manually closed by personal taste that it is nicer like that)

This commit is contained in:
Florent Viard 2014-06-09 04:21:02 +02:00
parent 12f161a158
commit 238caa94be
3 changed files with 11 additions and 12 deletions

View File

@ -21,18 +21,17 @@ input[type=checkbox], input[type=radio] {
.alerts { .alerts {
position: fixed; position: fixed;
left: 1em; _position: absolute;
right: 1em; right: 6px;
bottom: 1em;
z-index: 900; z-index: 900;
margin: 0; width: 40%;
padding: 0;
background: white;
background: rgba(255,255,255,0.7);
} }
.alert { .alert {
margin: 1em; float: right;
border-width: 0.5ex; clear: right;
margin-bottom: 5px;
margin-top: 5px;
} }
/* fix modal overflow on low resolutions */ /* fix modal overflow on low resolutions */

View File

@ -219,8 +219,8 @@
<!-- {{{ alerts --> <!-- {{{ alerts -->
<div ng-controller="AlertCtrl" class="row-fluid alerts"> <div ng-controller="AlertCtrl" class="row-fluid alerts">
<div class="alert alert-{{alert.type}}" ng-repeat="alert in pendingAlerts"> <div class="alert alert-{{alert.type}}" ng-repeat="alert in pendingAlerts">
<span ng-bind-html="alert.msg"></span>
<button type="button" class="close" ng-click="removeAlert($index)">x</button> <button type="button" class="close" ng-click="removeAlert($index)">x</button>
<span ng-bind-html="alert.msg"></span>
</div> </div>
</div> </div>
<!-- }}} --> <!-- }}} -->

View File

@ -23,10 +23,10 @@ angular.module('webui.ctrls.alert', [
scope.pendingAlerts[ind].expired = true; scope.pendingAlerts[ind].expired = true;
// only remove if more notifications are pending in the pipeline // only remove if more notifications are pending in the pipeline
if (scope.pendingAlerts.length > 1) if (scope.pendingAlerts.length > 0)
scope.removeAlert(ind); scope.removeAlert(ind);
} }
}, type == "error" ? 10000 : 3000); }, type == "error" ? 15000 : 5000);
scope.$digest(); scope.$digest();
}); });