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 {
position: fixed;
left: 1em;
right: 1em;
bottom: 1em;
_position: absolute;
right: 6px;
z-index: 900;
margin: 0;
padding: 0;
background: white;
background: rgba(255,255,255,0.7);
width: 40%;
}
.alert {
margin: 1em;
border-width: 0.5ex;
float: right;
clear: right;
margin-bottom: 5px;
margin-top: 5px;
}
/* fix modal overflow on low resolutions */

View File

@ -219,8 +219,8 @@
<!-- {{{ alerts -->
<div ng-controller="AlertCtrl" class="row-fluid alerts">
<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>
<span ng-bind-html="alert.msg"></span>
</div>
</div>
<!-- }}} -->

View File

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