flash-message
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -27,2 +27,5 @@ // | ||
$(function() { | ||
var defaultOptions = { | ||
timeout: 5000 | ||
}; | ||
var flashTimeout; | ||
@@ -37,2 +40,3 @@ var flashDiv = '<div id="flash" style="display:none;"> \ | ||
flash: function(content, options) { | ||
options = options || defaultOptions; | ||
var flash = $('#flash'); | ||
@@ -66,3 +70,5 @@ | ||
} | ||
flashTimeout = window.setTimeout(fadeAway, 5000); | ||
if(options.timeout) { | ||
flashTimeout = window.setTimeout(fadeAway, options.timeout); | ||
} | ||
}); | ||
@@ -72,3 +78,5 @@ | ||
$('#flash').hide(); | ||
window.clearTimeout(flashTimeout); | ||
if(flashTimeout) { | ||
window.clearTimeout(flashTimeout); | ||
} | ||
}); | ||
@@ -75,0 +83,0 @@ |
{ | ||
"name": "flash-message", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "A tiny plug-in to show flash messages at the top of the page that auto-hide.", | ||
@@ -5,0 +5,0 @@ "main": "jquery.flash.js", |
@@ -25,5 +25,2 @@ ## Flash Message Plugin | ||
To install, just include this javascript file and the accompanying CSS file into your | ||
HTML page. And that's it! | ||
Oh and don't forget the 'close' image. | ||
`npm install flash-message` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6718
133
26
1