Skip to content

Commit

Permalink
toast styling
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexChien committed Apr 6, 2016
1 parent 8a4b3f5 commit 41123ee
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
23 changes: 23 additions & 0 deletions app/css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -687,4 +687,27 @@ a.delegate-link {

.error-container {
color: red;
}


md-toast.md-notice-toast-theme {
.md-toast-content {
background-color: #1fa67a;
color:white;
}
}
md-toast.md-warning-toast-theme {
.md-toast-content {
background-color: #f5683b;
color:white;
}
}
md-toast.md-error-toast-theme {
.md-toast-content {
background-color: #ff4081;
color:white;
}
}
md-toast {
margin-bottom:40px;
}
3 changes: 3 additions & 0 deletions app/js/app.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ app.config ($mdThemingProvider, IdleProvider, $translateProvider, $tooltipProvid
$mdThemingProvider.theme('default').primaryPalette('indigo')

$compileProvider.debugInfoEnabled false
$mdThemingProvider.theme("warning-toast")
$mdThemingProvider.theme("notice-toast")
$mdThemingProvider.theme("error-toast")
# set this to false in production to gain performance boost
# use angular.reloadWithDebugInfo() to reload the page and obtain debug capability

Expand Down
5 changes: 3 additions & 2 deletions app/js/services/misc.coffee
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
servicesModule = angular.module("app.services")

servicesModule.factory "Growl", ($mdToast) ->
toastPosition: "right top"
fadeTime: 3000
toastPosition: "bottom right"
fadeTime: 3000000

error: (title, message) ->
# jQuery.growl.error(title: title, message: message)
Expand All @@ -23,5 +23,6 @@ servicesModule.factory "Growl", ($mdToast) ->
.content("#{message}")
.position(this.toastPosition)
.hideDelay(this.fadeTime)
.theme("#{type}-toast")
)

0 comments on commit 41123ee

Please sign in to comment.