olay-rails 0.1.5 → 0.1.6

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
  SHA512:
3
- data.tar.gz: 3114549633c5e25c242a848201f9462cada5a8f54470ecf30cee395add7c6d49598a8186d67902336010a8d0478f34b1d6311e1f3ba6e7c9fa86a024072a73dc
4
- metadata.gz: ca99747b6a1f88fd8e8797d573e3ef0c25c37f71ccc7c2aa18df2c97fc055ae21f771369839947cc65ecdf0e46b522fc5db5bf89a52ac2ab5d84dd02a6fb1fa8
3
+ data.tar.gz: d922b625d2399db9fd9bc1b07fe3961000174b0baf3e59a7b45a1c75970a9e67be5a79054f086c6383d2225b67276933e54c37173d582a16c7a35c19a95b135a
4
+ metadata.gz: 67f7e9b7f7cef9e074b5c1c89e256874cb642a8fc01d85a1e936a40e9a749b3a8313c26acfcbea55ad30bbd66ecdbd665405065f531ab3cbdf00e541470ec9c4
5
5
  SHA1:
6
- data.tar.gz: a5fa72dd98c53d38d620bbb98a6481f2765c8ee7
7
- metadata.gz: 4447c9c9feae298e14a42cce37bc46a3c8e3018a
6
+ data.tar.gz: 9e1869334061f37dcd966ecb4dd2bec62f1273f7
7
+ metadata.gz: e0f758ec192a8b16e759de4a89a230264fcc4626
@@ -1,6 +1,6 @@
1
1
  module Olay
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  module Rails
4
- VERSION = '0.1.5'
4
+ VERSION = '0.1.6'
5
5
  end
6
6
  end
@@ -9,10 +9,18 @@
9
9
  var $olay = $('.js-olay-container').last();
10
10
  var olay = $olay.data('olay');
11
11
  if (!olay) return;
12
- var pressed = ev.which;
12
+ var which = ev.which;
13
13
  var keys = olay.hideOnKeys || [];
14
14
  for (var i = 0, l = keys.length; i < l; ++i) {
15
- if (pressed === keys[i]) return olay.hide() && false;
15
+ if (which === keys[i]) return olay.hide() && false;
16
+ }
17
+ if (which === 9) {
18
+ setTimeout(function () {
19
+ if (!$olay.find(':focus').length) {
20
+ $(':focus').blur();
21
+ $olay.find(':input').first().focus();
22
+ }
23
+ }, 0);
16
24
  }
17
25
  });
18
26
 
@@ -143,12 +151,6 @@
143
151
  $olays.length && active === $body[0] ?
144
152
  $olays.last() :
145
153
  $(active);
146
- $(':input').each(function () {
147
- var $t = $(this);
148
- if ('olayTabindex' in $t.data()) return;
149
- $t.data('olayTabindex', $t.attr('tabindex') || null)
150
- .attr('tabindex', -1);
151
- });
152
154
  $body.addClass('js-olay-visible').append(this.$container);
153
155
  this.$content.attr('tabindex', 0).focus().removeAttr('tabindex');
154
156
  return this;
@@ -159,12 +161,7 @@
159
161
  this.$container.detach();
160
162
  this._$active.attr('tabindex', 0).focus().removeAttr('tabindex');
161
163
  var $olays = $('.js-olay-container');
162
- ($olays.length ? $olays.last() : $('body').removeClass('js-olay-visible'))
163
- .find(':input').each(function () {
164
- var $t = $(this);
165
- $t.attr('tabindex', $t.data('olayTabindex'))
166
- .removeData('olayTabindex');
167
- });
164
+ if (!$olays.length) $('body').removeClass('js-olay-visible');
168
165
  this.$el.trigger('hide');
169
166
  if (!this.preserve) this.destroy();
170
167
  return this;
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: olay-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Casey Foster
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2013-03-07 00:00:00 Z
13
+ date: 2013-03-08 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  prerelease: false
@@ -22,7 +22,7 @@ dependencies:
22
22
  version: "3.1"
23
23
  type: :runtime
24
24
  version_requirements: *id001
25
- description: Places Olay 0.1.5 in the Rails asset pipeline.
25
+ description: Places Olay 0.1.6 in the Rails asset pipeline.
26
26
  email:
27
27
  - c@sey.me
28
28
  executables: []