refactor flash
* make unobtrusive js * convert js to coffee
This commit is contained in:
parent
c177593e2c
commit
a9a5497915
4 changed files with 12 additions and 19 deletions
|
@ -1,17 +1,3 @@
|
|||
- if alert || notice
|
||||
- text = alert || notice
|
||||
%div{style: "display:none", id: "flash_container"}
|
||||
%center
|
||||
%h4= text
|
||||
:javascript
|
||||
$(function(){
|
||||
$("#flash_container").slideDown("slow");
|
||||
$("#flash_container").click(function(){
|
||||
$(this).slideUp("slow");
|
||||
});
|
||||
setTimeout("hideFlash()",3000);
|
||||
});
|
||||
|
||||
function hideFlash(){
|
||||
$("#flash_container").slideUp("slow");
|
||||
}
|
||||
- if text = alert || notice
|
||||
#flash-container
|
||||
%h4= text
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
%html{ lang: "en"}
|
||||
= render "layouts/head"
|
||||
%body.ui_basic.login-page
|
||||
= render partial: "layouts/flash"
|
||||
= render "layouts/flash"
|
||||
.container= yield
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue