Amaran jQuery plugin added (growl-like popups)
This commit is contained in:
parent
2d488c65a1
commit
1cc189ccdc
5 changed files with 36 additions and 13 deletions
|
|
@ -15,6 +15,7 @@
|
|||
//= require foundation
|
||||
//= require fancybox
|
||||
//= require cookies_eu
|
||||
//= require jquery.amaran
|
||||
//= require_tree .
|
||||
|
||||
$(function(){ $(document).foundation(); });
|
||||
|
|
|
|||
|
|
@ -12,4 +12,7 @@
|
|||
*= require foundation_and_overrides
|
||||
*= require cookies_eu
|
||||
*= require fancybox
|
||||
* https://github.com/hakanersu/AmaranJS
|
||||
*= require amaran
|
||||
**= require animate
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,15 +1,27 @@
|
|||
// Display alert messages to the user
|
||||
// Supported names are: .secondary, .primary, .success, .warning, or .alert
|
||||
|
||||
- if flash
|
||||
.row
|
||||
.small-6.small-centered.columns
|
||||
- flash.each do |name, msg|
|
||||
- case name
|
||||
- when 'notice'
|
||||
- colorclass='success'
|
||||
- else
|
||||
- colorclass='primary'
|
||||
div class="#{colorclass} callout" data-closable=true
|
||||
= msg
|
||||
button class='close-button' aria-label='Dismiss' type='button' data-close=true
|
||||
span aria-hidden=true ×
|
||||
- flash.each do |name,msg|
|
||||
- case name
|
||||
- when 'notice'
|
||||
- flash_color = 'white'
|
||||
- flash_bgcolor = 'green'
|
||||
- when 'alert'
|
||||
- flash_color = 'white'
|
||||
- flash_bgcolor = 'red'
|
||||
- else
|
||||
- flash_color = 'black'
|
||||
- flash_bgcolor = 'gray'
|
||||
|
||||
javascript:
|
||||
$.amaran({
|
||||
'content': {
|
||||
'message' :'#{name}: #{msg}',
|
||||
'color' : '#{flash_color}',
|
||||
'bgcolor' : '#{flash_bgcolor}'
|
||||
},
|
||||
'position' :'top right',
|
||||
'theme' : 'colorful',
|
||||
'cssanimationIn' :'bounceInDown',
|
||||
'cssanimationOut' :'zoomOutUp'
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue