corn_starch 1.9.7 → 1.9.8

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 12e0cf5fdc9d3a09f9ea072e0f174d024a2dd823
4
- data.tar.gz: 3b2d2ad90904f67e0f62f66c2d039c9fae83cc23
3
+ metadata.gz: ea6d017af58b1134e259d02b6e5426acf89815d9
4
+ data.tar.gz: dbe767e5ae4428c2cd0c247e271b3de8eeb65fba
5
5
  SHA512:
6
- metadata.gz: 05baaf9f2371f6287ba55d52fd0cdcd90a4ac2637cbba8930b7ec7e4731c53e0e756d1d3de147af156879295b7d82dc07fdff1cc857737599109f87282770ed7
7
- data.tar.gz: 9cc9fa58d17bee3540b07e4a3c7ab626b2d7a20995ff3205b93e070d2ef3def57f720e958e1b2f6bb2ac665c1dd552067e89cc9a26259cac0fbee84329cf61f2
6
+ metadata.gz: c16077b7ad23540024892d4f577cf3da9c04426d32d195603c55623efccc422a3048aa4e9a8cbf33c90a13bdb3a321571cd42e8d87177daffd3f5737a136c5cf
7
+ data.tar.gz: 1ca1d2b5d1ea53f75a1c180a115f5c5a6619107558cddbb8beac6af2fcbe41c8ae580ca4c2db857b4c8afed789c80e8f37b77345e713041c87787c04a5d635fb
@@ -3,19 +3,28 @@
3
3
 
4
4
  # Modal JS
5
5
 
6
+ # Currently Displayed Modal
7
+ window.modal_displayed = null
8
+
6
9
  # Show Modal
7
10
  window.modal_show = (modal) ->
8
11
  e = $("#modal-#{modal}")
9
12
  onshow = e.attr 'modal-onshow'
10
13
  window[onshow]() if onshow? && onshow != ''
14
+ modal_displayed = modal
11
15
  e.show 'fast'
12
16
 
13
17
  # Hide Modal
14
18
  window.modal_hide = (modal) ->
19
+ modal_displayed = null
15
20
  $("#modal-#{modal}").hide 'fast'
16
21
 
22
+ # Is Modal Visible
23
+ window.modal_visible = (modal) ->
24
+ $("#modal-#{modal}").is ':visible'
25
+
17
26
  # Init Modal
18
- window.modal_init = (modal) ->
27
+ window.modal_init_modal = (modal) ->
19
28
 
20
29
  # Wire up Quick Hide (Click Outside Modal)
21
30
  if $("#modal-#{modal}").length
@@ -30,4 +39,20 @@ window.modal_init = (modal) ->
30
39
  # Wire up Hide Button
31
40
  if $("#modal-#{modal}-btn-hide").length
32
41
  $("#modal-#{modal}-btn-hide").click ->
33
- modal_hide modal
42
+ modal_hide modal
43
+
44
+ # Handle Key Presses
45
+ window.modal_handle_keyup = (e) ->
46
+
47
+ # Check Modal Visible
48
+ return if modal_displayed == null
49
+
50
+ # Hide Modal
51
+ modal_hide modal_displayed if e.which == 27
52
+
53
+
54
+ # Init Modal System
55
+ window.modal_init = ->
56
+
57
+ # Handle Key Presses
58
+ $(document).keyup modal_handle_keyup
@@ -4,4 +4,4 @@
4
4
  <% end %>
5
5
 
6
6
  <%# Modal JS %>
7
- <script>modal_init('<%= modal[:name] %>');</script>
7
+ <script>modal_init_modal('<%= modal[:name] %>');</script>
@@ -1,3 +1,3 @@
1
1
  module CornStarch
2
- VERSION = '1.9.7'
2
+ VERSION = '1.9.8'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: corn_starch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.7
4
+ version: 1.9.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eresse
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-06-28 00:00:00.000000000 Z
11
+ date: 2016-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler