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
00cc34cc
Commit
00cc34cc
authored
May 31, 2017
by
kushalpandya
Committed by
Jarka Kadlecova
Jun 01, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add doc comment
parent
84c68bb1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
app/assets/javascripts/flash.js
app/assets/javascripts/flash.js
+15
-2
No files found.
app/assets/javascripts/flash.js
View file @
00cc34cc
...
...
@@ -7,6 +7,19 @@ window.Flash = (function() {
return
$
(
this
).
fadeOut
();
};
/**
* Flash banner supports different types of Flash configurations
* along with ability to provide actionConfig which can be used to show
* additional action or link on banner next to message
*
* @param {String} message Flash message
* @param {String} type Type of Flash, it can be `notice` or `alert` (default)
* @param {Object} parent Reference to Parent element under which Flash needs to appear
* @param {Object} actionConfig Map of config to show action on banner
* @param {String} href URL to which action link should point (default '#')
* @param {String} title Title of action
* @param {Function} clickHandler Method to call when action is clicked on
*/
function
Flash
(
message
,
type
,
parent
,
actionConfig
)
{
var
flash
,
textDiv
,
actionLink
;
if
(
type
==
null
)
{
...
...
@@ -33,8 +46,8 @@ window.Flash = (function() {
if
(
actionConfig
)
{
actionLink
=
$
(
'
<a/>
'
,
{
"
class
"
:
"
flash-action
"
,
"
href
"
:
"
#
"
,
class
:
'
flash-action
'
,
href
:
actionConfig
.
href
||
'
#
'
,
text
:
actionConfig
.
title
});
...
...
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