Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
a9a54979
Commit
a9a54979
authored
Nov 29, 2012
by
Cyril
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor flash
* make unobtrusive js * convert js to coffee
parent
c177593e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
19 deletions
+12
-19
app/assets/javascripts/main.js.coffee
app/assets/javascripts/main.js.coffee
+5
-0
app/assets/stylesheets/common.scss
app/assets/stylesheets/common.scss
+3
-1
app/views/layouts/_flash.html.haml
app/views/layouts/_flash.html.haml
+3
-17
app/views/layouts/devise.html.haml
app/views/layouts/devise.html.haml
+1
-1
No files found.
app/assets/javascripts/main.js.coffee
View file @
a9a54979
...
@@ -33,6 +33,11 @@ $ ->
...
@@ -33,6 +33,11 @@ $ ->
# Bottom tooltip
# Bottom tooltip
$
(
'.has_bottom_tooltip'
).
tooltip
(
placement
:
'bottom'
)
$
(
'.has_bottom_tooltip'
).
tooltip
(
placement
:
'bottom'
)
# Flash
if
(
flash
=
$
(
"#flash-container"
)).
length
>
0
flash
.
click
->
$
(
@
).
slideUp
(
"slow"
)
flash
.
slideDown
"slow"
setTimeout
(
->
flash
.
slideUp
(
"slow"
)),
3000
# Disable form buttons while a form is submitting
# Disable form buttons while a form is submitting
$
(
'body'
).
on
'ajax:complete, ajax:beforeSend, submit'
,
'form'
,
(
e
)
->
$
(
'body'
).
on
'ajax:complete, ajax:beforeSend, submit'
,
'form'
,
(
e
)
->
...
...
app/assets/stylesheets/common.scss
View file @
a9a54979
...
@@ -68,7 +68,7 @@ table a code {
...
@@ -68,7 +68,7 @@ table a code {
}
}
/** FLASH message **/
/** FLASH message **/
#flash
_
container
{
#flash
-
container
{
height
:
50px
;
height
:
50px
;
position
:
fixed
;
position
:
fixed
;
z-index
:
10001
;
z-index
:
10001
;
...
@@ -79,6 +79,8 @@ table a code {
...
@@ -79,6 +79,8 @@ table a code {
background
:
white
;
background
:
white
;
cursor
:
pointer
;
cursor
:
pointer
;
border-bottom
:
1px
solid
#ccc
;
border-bottom
:
1px
solid
#ccc
;
text-align
:
center
;
display
:
none
;
h4
{
h4
{
color
:
#666
;
color
:
#666
;
...
...
app/views/layouts/_flash.html.haml
View file @
a9a54979
-
if
alert
||
notice
-
if
text
=
alert
||
notice
-
text
=
alert
||
notice
#flash-container
%div
{
style:
"display:none"
,
id:
"flash_container"
}
%center
%h4
=
text
%h4
=
text
:javascript
$
(
function
(){
$
(
"
#flash_container
"
).
slideDown
(
"
slow
"
);
$
(
"
#flash_container
"
).
click
(
function
(){
$
(
this
).
slideUp
(
"
slow
"
);
});
setTimeout
(
"
hideFlash()
"
,
3000
);
});
function
hideFlash
(){
$
(
"
#flash_container
"
).
slideUp
(
"
slow
"
);
}
app/views/layouts/devise.html.haml
View file @
a9a54979
...
@@ -2,5 +2,5 @@
...
@@ -2,5 +2,5 @@
%html
{
lang:
"en"
}
%html
{
lang:
"en"
}
=
render
"layouts/head"
=
render
"layouts/head"
%body
.ui_basic.login-page
%body
.ui_basic.login-page
=
render
partial:
"layouts/flash"
=
render
"layouts/flash"
.container
=
yield
.container
=
yield
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment