lighter_box 0.3.1 → 0.3.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: c71f3b339e2f7fd9dc052ad12c61417405f9c8dc
4
- data.tar.gz: 52584ff7b95b11793e73ea47e7e2ecf8ffc97fec
3
+ metadata.gz: 2e76c9d269dc37b520fb19a6a1a43953e65dcbfb
4
+ data.tar.gz: e03676b8d0bfcd5d298c7c26b00e0e9182129315
5
5
  SHA512:
6
- metadata.gz: f568f1c09df719a2be68ec66d5ed2fcac551e74e3107e507bfcbb7cf520b09d9ca1ce15f7869afc18df1827189e3e8dddb5814ccda445a5143814f8c6fdaa8a5
7
- data.tar.gz: bc66eae2d468217f1620495c48569d5940bcc01c17795febb4d924418b8ca512d460f94f6d3a4cbdd8dcf89907ac9da30978c804816bd8e09e28170b39173c6f
6
+ metadata.gz: 80169d02311e17ad085b71bd4b7f74dc93c80436e240eb6d3f15c454d7b47271ec78bfad70c867e5b94263079a32c90338f315b9982d0ecd76d8b83c33fb3808
7
+ data.tar.gz: 8994fa3fecfdc334d65e38ad7ffca77bb42a486d2aba4e8e4450240a788b52e0c9a403fb14ebeb83d3847b8f526892eeb13d5f0684e59f0bf07dfec5c9e6de9b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v0.3.2
2
+
3
+ * Gallery mode: Ignore hidden source elements. This makes the gallery mode compatible with all sorts of client side filtering. As a side effect, the list of source elements used for gallery mode is now determined at the moment the lightbox is openend (in earlier versions it was determined when lighter box was initialized).
4
+
1
5
  # v0.3.1
2
6
 
3
7
  * Reset margins and padding for `figure` element used in image lightboxes (some CSS frameworks – eg. Bootstrap – apply non-zero margins to `figure` elements by default).
data/README.md CHANGED
@@ -49,7 +49,7 @@ $("body").on "click", "a[data-lightbox]", (ev) ->
49
49
  The following attributes on the source element (link) can be used to customize LighterBox:
50
50
 
51
51
  * `data-lightbox-class`: Additional css class names for the lightbox modal.
52
- * `data-lightbox-group`: Used for gallery mode: Next / previous links will be displayed to allow navigation between lightboxes for source elements that share the save value for this attribute.
52
+ * `data-lightbox-group`: Used for gallery mode: Next / previous links will be displayed to allow navigation between lightboxes for source elements that share the save value for this attribute. Hidden source elements are ignored, so the gallery mode works well with all sorts of client side filtering.
53
53
 
54
54
  Image lightbox only:
55
55
 
@@ -42,32 +42,33 @@ class Spinner
42
42
 
43
43
  class LightboxGroup
44
44
  constructor: (@currentEl) ->
45
- @elems = if (groupName = @currentEl.attr("data-lightbox-group"))
46
- $("[data-lightbox-group='#{groupName}']")
47
- else
48
- @currentEl
49
45
 
50
46
  index: =>
51
- @elems.index(@currentEl)
47
+ @_elems().index(@currentEl)
52
48
 
53
49
  hasNext: =>
54
- @index() + 1 < @elems.length
50
+ @index() + 1 < @_elems().length
55
51
 
56
52
  hasPrev: =>
57
53
  @index() - 1 >= 0
58
54
 
59
55
  nextHref: =>
60
- @elems.eq(@index() + 1).attr("href")
56
+ @_elems().eq(@index() + 1).attr("href")
61
57
 
62
58
  prevHref: =>
63
- @elems.eq(@index() - 1).attr("href")
59
+ @_elems().eq(@index() - 1).attr("href")
64
60
 
65
61
  next: =>
66
- @currentEl = @elems.eq(@index() + 1)
62
+ @currentEl = @_elems().eq(@index() + 1)
67
63
 
68
64
  prev: =>
69
- @currentEl = @elems.eq(@index() - 1)
65
+ @currentEl = @_elems().eq(@index() - 1)
70
66
 
67
+ _elems: =>
68
+ if (groupName = @currentEl.attr("data-lightbox-group"))
69
+ $("[data-lightbox-group='#{groupName}']:visible")
70
+ else
71
+ @currentEl
71
72
 
72
73
 
73
74
  class ImageModalResizer
@@ -1,3 +1,3 @@
1
1
  module LighterBox
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lighter_box
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Daschek
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-27 00:00:00.000000000 Z
11
+ date: 2017-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coffee-script