simple_flash_helper 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,6 @@
1
+ var close_btn = '<button class="close" data-dismiss="alert">&times;</button>';
2
+ var speed = 4500;
3
+
1
4
  $(document).ready(function() {
2
5
 
3
6
  // Remove the flash notice on click
@@ -8,7 +11,7 @@ $(document).ready(function() {
8
11
  });
9
12
 
10
13
  // Automatically remove the div after 4.5 seconds
11
- $('#flash_helper > div').delay(4500).fadeOut('fast', function(){
14
+ $('#flash_helper > div').delay(speed).fadeOut('fast', function(){
12
15
  $(this).remove();
13
16
  });
14
17
 
@@ -20,8 +23,8 @@ var flash_helper = {
20
23
  // Dynamically create a flash notice
21
24
  create: function(message, type){
22
25
  var type = type ? "alert-" + type : "alert-success";
23
- var $new_message = $('<div class="alert ' + type + '">'+message+'</div>');
24
- $new_message.delay(2500).fadeOut('fast', function(){
26
+ var $new_message = $('<div class="alert ' + type + '">' + message + close_btn + '</div>');
27
+ $new_message.delay(speed).fadeOut('fast', function(){
25
28
  $(this).remove();
26
29
  });
27
30
  $('#flash_helper').append($new_message)
@@ -30,6 +33,6 @@ var flash_helper = {
30
33
  // Clear all the flash notices
31
34
  clear: function() {
32
35
  $('#flash_helper').html('');
33
- }
36
+ },
34
37
 
35
38
  };
@@ -1,3 +1,3 @@
1
1
  module SimpleFlashHelper
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_flash_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-03 00:00:00.000000000 Z
12
+ date: 2013-08-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler