olay-rails 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA512:
3
+ metadata.gz: 8d16360f660ab207a3e356b1194c38fbdb7b85820f45f8d0a740156ecb9b29a76f4b083f18e96b272d0ff7c7613568dc0667a5010e165072ac0dd0193b64ea2f
4
+ data.tar.gz: dd4b1538c1fd9e6e902f86b3b12a0915b4bc98eff76bc347b5703fcf8521614874ee3eb87a73e95cc2c2d9514abdc7898add0629e6a6982800e00e9bb22a2469
5
+ SHA1:
6
+ metadata.gz: f90c29a004e86a52266532b787f1f1f896ea7986
7
+ data.tar.gz: 28cb2f64e0cc044e2c94092fc90c03e63bb6dca7
@@ -1,6 +1,6 @@
1
1
  module Olay
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  module Rails
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end
6
6
  end
@@ -105,14 +105,20 @@
105
105
 
106
106
  // Append `$container` to the DOM. Used internally.
107
107
  _append: function () {
108
- this._activeElement = document.activeElement;
108
+ var $body = $('body');
109
+ var $olays = $('.js-olay-container');
110
+ var active = document.activeElement;
111
+ this._$active =
112
+ $olays.length && active === $body[0] ?
113
+ $olays.last() :
114
+ $(active);
109
115
  $(':input').each(function () {
110
116
  var $t = $(this);
111
117
  if ('olayTabindex' in $t.data()) return;
112
118
  $t.data('olayTabindex', $t.attr('tabindex') || null)
113
119
  .attr('tabindex', -1);
114
120
  });
115
- $('body').addClass('js-olay-visible').append(this.$container);
121
+ $body.addClass('js-olay-visible').append(this.$container);
116
122
  this.$content.attr('tabindex', 0).focus().removeAttr('tabindex');
117
123
  return this;
118
124
  },
@@ -120,6 +126,7 @@
120
126
  // Detach or remove `$container` from the DOM. Used internally.
121
127
  _remove: function () {
122
128
  this.$container.remove();
129
+ this._$active.attr('tabindex', 0).focus().removeAttr('tabindex');
123
130
  var $olays = $('.js-olay-container');
124
131
  ($olays.length ? $olays.last() : $('body').removeClass('js-olay-visible'))
125
132
  .find(':input').each(function () {
@@ -127,7 +134,6 @@
127
134
  $t.attr('tabindex', $t.data('olayTabindex'))
128
135
  .removeData('olayTabindex');
129
136
  });
130
- this._activeElement.focus();
131
137
  return this;
132
138
  }
133
139
  };
metadata CHANGED
@@ -1,13 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: olay-rails
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
5
- prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- - 1
10
- version: 0.1.1
4
+ version: 0.1.2
11
5
  platform: ruby
12
6
  authors:
13
7
  - Casey Foster
@@ -20,20 +14,15 @@ date: 2013-03-06 00:00:00 Z
20
14
  dependencies:
21
15
  - !ruby/object:Gem::Dependency
22
16
  prerelease: false
23
- version_requirements: &id001 !ruby/object:Gem::Requirement
24
- none: false
17
+ name: rails
18
+ requirement: &id001 !ruby/object:Gem::Requirement
25
19
  requirements:
26
20
  - - ">="
27
21
  - !ruby/object:Gem::Version
28
- hash: 5
29
- segments:
30
- - 3
31
- - 1
32
22
  version: "3.1"
33
- requirement: *id001
34
- name: rails
35
23
  type: :runtime
36
- description: Places Olay 0.1.0 in the Rails asset pipeline.
24
+ version_requirements: *id001
25
+ description: Places Olay 0.1.1 in the Rails asset pipeline.
37
26
  email:
38
27
  - c@sey.me
39
28
  executables: []
@@ -57,35 +46,28 @@ files:
57
46
  homepage: https://github.com/orgsync/olay-rails
58
47
  licenses:
59
48
  - MIT
49
+ metadata: {}
50
+
60
51
  post_install_message:
61
52
  rdoc_options: []
62
53
 
63
54
  require_paths:
64
55
  - lib
65
56
  required_ruby_version: !ruby/object:Gem::Requirement
66
- none: false
67
57
  requirements:
68
- - - ">="
58
+ - &id002
59
+ - ">="
69
60
  - !ruby/object:Gem::Version
70
- hash: 3
71
- segments:
72
- - 0
73
61
  version: "0"
74
62
  required_rubygems_version: !ruby/object:Gem::Requirement
75
- none: false
76
63
  requirements:
77
- - - ">="
78
- - !ruby/object:Gem::Version
79
- hash: 3
80
- segments:
81
- - 0
82
- version: "0"
64
+ - *id002
83
65
  requirements: []
84
66
 
85
67
  rubyforge_project:
86
- rubygems_version: 1.8.15
68
+ rubygems_version: 2.0.0
87
69
  signing_key:
88
- specification_version: 3
70
+ specification_version: 4
89
71
  summary: Overlays that don't suck.
90
72
  test_files: []
91
73