lighter_box 0.3.1 → 0.3.2
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/lib/assets/javascripts/lighter_box.coffee +11 -10
- data/lib/lighter_box/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e76c9d269dc37b520fb19a6a1a43953e65dcbfb
|
4
|
+
data.tar.gz: e03676b8d0bfcd5d298c7c26b00e0e9182129315
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
@
|
47
|
+
@_elems().index(@currentEl)
|
52
48
|
|
53
49
|
hasNext: =>
|
54
|
-
@index() + 1 < @
|
50
|
+
@index() + 1 < @_elems().length
|
55
51
|
|
56
52
|
hasPrev: =>
|
57
53
|
@index() - 1 >= 0
|
58
54
|
|
59
55
|
nextHref: =>
|
60
|
-
@
|
56
|
+
@_elems().eq(@index() + 1).attr("href")
|
61
57
|
|
62
58
|
prevHref: =>
|
63
|
-
@
|
59
|
+
@_elems().eq(@index() - 1).attr("href")
|
64
60
|
|
65
61
|
next: =>
|
66
|
-
@currentEl = @
|
62
|
+
@currentEl = @_elems().eq(@index() + 1)
|
67
63
|
|
68
64
|
prev: =>
|
69
|
-
@currentEl = @
|
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
|
data/lib/lighter_box/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2017-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coffee-script
|