lazybox 1.1.1 → 1.1.2

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: 182f11f45966690f7900c90832787624db2fa82d
4
- data.tar.gz: 0a050dd9345c89ed99fb19b6b08c1bab21859e22
3
+ metadata.gz: 0662494ff4a4dbebf2df420c06a9dfe11e2a254c
4
+ data.tar.gz: 55258e0eb76f7ba29f68a5b68de27c0c87930777
5
5
  SHA512:
6
- metadata.gz: e13e1b69c41054c6fdd84b9704173809ce17120bc998b57851f361f3fc991e402e0249f5b0c6441d6bd0e9c54e266a6a3610f2d0bfeadbe51d8887338f725970
7
- data.tar.gz: bd005ce3603688589f450f9792ebd03e4293a337a2c1e1c1ea8eca62102272ae8592b07b0303393604224a4f6a6e13427ce3be3d7f31beb10b9c61e1dca2579b
6
+ metadata.gz: fff9d3710a05e70ba8ebe8b9d6f46a65b75a688185f7fa3677ffe630cefe4ed3efaf78a979ab93c31b14e3639e96694de378b6b40c2b29bbcf6aacebfbbb23b0
7
+ data.tar.gz: 2fd64ef850b19910da81c2bc93cf7d2323e0dfdde36ecc147d95f0f2fff5a22f73ff15825ae4f4a2bcf0812f3d8f654ee40a47b21324833856a7f4555e305e5c
data/README.md CHANGED
@@ -32,7 +32,7 @@ Add to your layout helper `render_lazybox`:
32
32
 
33
33
  ```slim
34
34
  ...
35
- render_lazybox(active: true)
35
+ render_lazybox
36
36
  body
37
37
  html
38
38
  ```
@@ -51,7 +51,9 @@
51
51
  options = $.extend {}, defaults, $.lazybox.settings, options
52
52
  $('#lazybox').attr('class', options.klass)
53
53
  $('#lazy_close').toggleClass('visible', options.close)
54
- $('#lazy_overlay').one 'click', $.lazybox.close unless options.modal
54
+ unless options.modal
55
+ $('#lazy_overlay').one 'click', (e) ->
56
+ $.lazybox.close() if e.target == @
55
57
  $(document).on 'keyup.lazy', (e) ->
56
58
  if e.keyCode == 27 and options.esc
57
59
  $.lazybox.close()
@@ -11,6 +11,7 @@ $lazy-close: '×' !default;
11
11
 
12
12
  #lazy_overlay {
13
13
  visibility: hidden;
14
+ text-align: center;
14
15
  z-index: $lazy-z-index;
15
16
  background: $lazy-overlay;
16
17
  bottom: 0;
@@ -20,30 +21,32 @@ $lazy-close: '×' !default;
20
21
  top: 0;
21
22
  opacity: 0;
22
23
  transition: opacity $lazy-transition, visibility $lazy-transition;
24
+ &:before {
25
+ content: '';
26
+ display: inline-block;
27
+ height: 100%;
28
+ vertical-align: middle;
29
+ }
23
30
  &.active {
24
31
  visibility: visible;
25
32
  opacity: 1;
26
- + #lazybox {
27
- visibility: visible;
28
- transform: translate(-50%, -50%) $lazy-end;
29
- opacity: 1;
30
- }
33
+ #lazybox { transform: $lazy-end; }
34
+ }
35
+ * {
36
+ visibility: inherit;
31
37
  }
32
38
  }
33
39
 
34
40
  #lazybox {
35
- visibility: hidden;
36
- opacity: 0;
37
- top: 50%;
38
- left: 50%;
39
- transform: translate(-50%, -50%) $lazy-start;
41
+ text-align: left;
42
+ display: inline-block;
43
+ vertical-align: middle;
44
+ transform: $lazy-start;
40
45
  background-color: $lazy-bg;
41
46
  border: $lazy-border;
42
47
  box-shadow: $lazy-shadow;
43
48
  padding: $lazy-padding;
44
- position: fixed;
45
49
  box-sizing: border-box;
46
- z-index: $lazy-z-index + 1;
47
50
  overflow: auto;
48
51
  max-height: 100vh;
49
52
  max-width: 100vw;
@@ -51,9 +54,7 @@ $lazy-close: '×' !default;
51
54
  &.confirm { max-width: 300px; }
52
55
  .lazy_buttons { margin-top: 15px; text-align: right; }
53
56
  .lazy-img { display: block; }
54
- #lazy_body {
55
- position: relative;
56
- }
57
+ #lazy_body { position: relative; }
57
58
  }
58
59
 
59
60
  #lazy_close {
@@ -6,11 +6,12 @@ module Lazybox
6
6
  module Helper
7
7
 
8
8
  def render_lazybox(options = {})
9
- content_tag(:div, '', id: :lazy_overlay, class: ('active' if options[:active] && content_for?(:lazybox))) +
9
+ content_tag(:div, '', id: :lazy_overlay, class: ('active' if content_for?(:lazybox))) do
10
10
  content_tag(:div, id: :lazybox) do
11
- button_tag('', id: :lazy_close, class: :visible) +
11
+ button_tag('', id: :lazy_close, class: :visible) +
12
12
  content_tag(:div, id: :lazy_body) do
13
- content_for(:lazybox)
13
+ content_for(:lazybox)
14
+ end
14
15
  end
15
16
  end
16
17
  end
@@ -1,3 +1,3 @@
1
1
  module Lazybox
2
- VERSION = '1.1.1'
2
+ VERSION = '1.1.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lazybox
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Galushka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-23 00:00:00.000000000 Z
11
+ date: 2015-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jquery-rails
@@ -58,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
58
58
  version: '0'
59
59
  requirements: []
60
60
  rubyforge_project:
61
- rubygems_version: 2.2.2
61
+ rubygems_version: 2.4.5
62
62
  signing_key:
63
63
  specification_version: 4
64
64
  summary: Use LazyBox for popup windows with Rails