twitter-bootstrap-rails-confirm 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fe8bd30ec1e2653ab77da911c4a74a28f41e55b6
4
- data.tar.gz: 989b0d3308c31bc53e408928de07489fd23697f5
3
+ metadata.gz: c8821ef99564c64d8525de8ed4373577b1626613
4
+ data.tar.gz: 16d1fe056096814cf1d299000613e9c2c3bbc830
5
5
  SHA512:
6
- metadata.gz: b753fc8675862f2a51f4d31986b23533ac1d2a188bc1713c0ebf08a523a672ff1ca496e51c654132dc49d88a7a3c65983509c41c42bdd764406a947819207813
7
- data.tar.gz: c87aa22cc7b9f16c2a5a8927872f6d2f697ffa59beac9eeaafb4da122318c114954eb9faf4a6626661be29969a34d98f20c7b4f97e5c29cadf357c9416e439dc
6
+ metadata.gz: 85f7232c319371335693dbf30aee1e1c49fb62a414d8016b3abd1fca7eadde943879717445420486d4942f1d663d193d192e58147eef3525215bfae2fbe2a905
7
+ data.tar.gz: 0c3b6b08efffdff051050240840515c105250d51c8803e9e59fcd11c3c2353444d995e2dbf7eafc640c1f5c765bc124e1fbc2539992fd5ed2da26e3277ed178a
data/README.md CHANGED
@@ -21,7 +21,8 @@ Changing all default values:
21
21
  cancel: "Cancel",
22
22
  cancel_class: "btn cancel",
23
23
  proceed: "OK",
24
- proceed_class: "btn proceed btn-primary"
24
+ proceed_class: "btn proceed btn-primary",
25
+ modal_class: ""
25
26
  };
26
27
 
27
28
  Only changing one default value:
@@ -38,6 +39,8 @@ And then execute:
38
39
 
39
40
  $ bundle
40
41
 
42
+ Note: [jQuery-Rails should be > 2.2.1](https://github.com/bluerail/twitter-bootstrap-rails-confirm/issues/27). The exact required version has not yet been determined.
43
+
41
44
  ## Usage
42
45
 
43
46
  Add it to your application.js, anywhere after you require jquery_ujs:
@@ -69,6 +72,11 @@ Next... nothing. There is nothing you need to do to get this working. A helper c
69
72
 
70
73
  ## Changelog
71
74
 
75
+ ### 1.0.5 (February 5, 2016)
76
+
77
+ * [(marceuy)](https://github.com/marceuy) [Added option for styling dialog](https://github.com/bluerail/twitter-bootstrap-rails-confirm/pull/31)
78
+ * [(joseramonc)](https://github.com/joseramonc) [Confirm dialog on enter keypress](https://github.com/bluerail/twitter-bootstrap-rails-confirm/pull/33)
79
+
72
80
  ### 1.0.4 (November 25, 2014)
73
81
 
74
82
  * [(rvanlieshout)](https://github.com/rvanlieshout) Added bootstrap 3 support
@@ -2,7 +2,7 @@ module Twitter
2
2
  module Bootstrap
3
3
  module Rails
4
4
  module Confirm
5
- VERSION = "1.0.4"
5
+ VERSION = "1.0.5"
6
6
  end
7
7
  end
8
8
  end
@@ -6,6 +6,7 @@ $.fn.twitter_bootstrap_confirmbox =
6
6
  cancel: "Cancel"
7
7
  cancel_class: "btn cancel"
8
8
  fade: false
9
+ modal_class: ""
9
10
 
10
11
  TwitterBootstrapConfirmBox = (message, element, callback) ->
11
12
  bootstrap_version = if (typeof $().emulateTransitionEnd == 'function') then 3 else 2
@@ -37,6 +38,8 @@ TwitterBootstrapConfirmBox = (message, element, callback) ->
37
38
  </div>
38
39
  ')
39
40
 
41
+ $dialog.addClass(element.data("confirm-modal-class") || $.fn.twitter_bootstrap_confirmbox.defaults.modal_class)
42
+
40
43
  $dialog.addClass("fade") if element.data("confirm-fade") || $.fn.twitter_bootstrap_confirmbox.defaults.fade
41
44
 
42
45
  $dialog
@@ -72,6 +75,10 @@ TwitterBootstrapConfirmBox = (message, element, callback) ->
72
75
  )
73
76
  )
74
77
  .end()
78
+
79
+ .on('keypress', (e) ->
80
+ $('.modal-footer a:last').trigger('click') if e.keyCode == 13 # Enter Key Code
81
+ )
75
82
 
76
83
  .on("hidden", -> $(this).remove())
77
84
 
@@ -81,6 +88,7 @@ TwitterBootstrapConfirmBox = (message, element, callback) ->
81
88
 
82
89
  if (typeof $().modal == 'function') # test if bootstrap is loaded
83
90
  $.rails.allowAction = (element) ->
91
+ $(element).blur();
84
92
  message = element.data("confirm")
85
93
  answer = false
86
94
  return true unless message
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitter-bootstrap-rails-confirm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rene van Lieshout
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-25 00:00:00.000000000 Z
11
+ date: 2016-02-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Confirm dialogs using Twitter Bootstrap
14
14
  email:
@@ -52,3 +52,4 @@ signing_key:
52
52
  specification_version: 4
53
53
  summary: Applies a custom confirm dialog for elements with a data-confirm attribute.
54
54
  test_files: []
55
+ has_rdoc: