mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
dismissable errors and warnings, fix #1580
This commit is contained in:
@@ -42,6 +42,10 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
|
||||
alert("This feature is not yet ported from the original site.");
|
||||
}
|
||||
|
||||
$rootScope.dismissErrorOrWarning = function(type, $index){
|
||||
$rootScope.flash[type].splice($index, 1);
|
||||
}
|
||||
|
||||
$rootScope.showStripe = function() {
|
||||
StripeCheckout.open({
|
||||
key: window.env.STRIPE_PUB_KEY,
|
||||
|
||||
@@ -95,8 +95,12 @@ html
|
||||
#wrap
|
||||
|
||||
// Errors
|
||||
.unstyled.alert.alert-error(ng-repeat='error in flash.errors track by $index') {{error}}
|
||||
.unstyled.alert.alert-error(ng-repeat='error in flash.warnings track by $index') {{error}}
|
||||
.unstyled.alert.alert-error(ng-repeat='error in flash.errors track by $index')
|
||||
| {{error}}
|
||||
button.close(type='button', ng-click='dismissErrorOrWarning("errors", $index)') ×
|
||||
.unstyled.alert.alert-error(ng-repeat='error in flash.warnings track by $index')
|
||||
| {{error}}
|
||||
button.close(type='button', ng-click='dismissErrorOrWarning("warnings", $index)') ×
|
||||
|
||||
//if they hide the header, we still need user-menu visible
|
||||
div(ng-if='user.preferences.hideHeader')
|
||||
|
||||
Reference in New Issue
Block a user