lighter_box 0.4.0 → 0.5.0

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: 542e811ff27d9867910949714c5c98ecac65db94
4
- data.tar.gz: 857ecce64e1f8433c2a450136977bc89bb1c070e
3
+ metadata.gz: 5cc3de2a858740165f60e3f8de7b6faafdb6cb40
4
+ data.tar.gz: 9ea5f34cc88a9f9967979d4431131d3f160c55bc
5
5
  SHA512:
6
- metadata.gz: 9403dc13b70f64fc9e9379a2c0ef87839219eab43449ffdde113e5886ef06685ae7e998835455d1f9809e22ea4fad6d4e235d7334a1c1b693b9a0b3c48b61482
7
- data.tar.gz: 34aa54a7de14b2ec17daae8b343f72b6be44ea8024442f61682e587441d0c5bbeddba3c57508229550e647f7ca4bf3d0ac96d1e03562aa7ff6d04789667329e9
6
+ metadata.gz: 3bfd3a01f7ae759cf5af05470329da71e07d5b027fce16483526f208793dd7f342e00c9fa57ade38c3fac29648c706e06d6ca71d08fb2f049cc227dcb945cdeb
7
+ data.tar.gz: 95888dca77c7ddc5a5c6ee30fa56c3b4a1f9b21d27926e97146b8d77924ccfbd49c55b73d2d00ccc227bfad7430c8710030a14c0813641fb86ffabdc1be4f1f6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # v0.5.0
2
+ * Option `data-lightbox-href` can now also be used for image lightboxes.
3
+
1
4
  # v0.4.0
2
5
  * New fullscreen mode for small screen devices.
3
6
  * Close button is now positioned outside the lightbox, resulting in a larger click target and more consistent placement with the previous/next links in gallery mode Also, the close button is now already visible when the lightbox content is loading, allowing the user to abort the loading process. (Technically this has already been possible by simply clicking on the backdrop, but this is not really discoverable from an UX standpoint).
data/README.md CHANGED
@@ -52,6 +52,7 @@ The following attributes on the source element (link) can be used to customize L
52
52
 
53
53
  * `data-lightbox-class`: Additional css class names for the lightbox modal.
54
54
  * `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. Note that this feature relies on jQuery’s `:visible` selector, which might yield unexpected results (eg. for links wrapping block elements, see https://github.com/jquery/jquery/issues/2227).
55
+ * `data-lightbox-href`: The URL that to be loaded into the lightbox. If not set, the link’s `href` attribute is used. If used with an image lightbox, this URL must also point to an image (common usecase: the link points to the original image file, but the lightbox should display a smaller version of the image instead).
55
56
 
56
57
  Image lightbox only:
57
58
 
@@ -61,7 +62,6 @@ Image lightbox only:
61
62
  Ajax lightbox only:
62
63
 
63
64
  * `data-lightbox-fragment`: A jQuery selector to specify the portion of the remote document to be loaded into the lightbox (similar to the fragment feature of [`jQuery.load()`](http://api.jquery.com/load/)).
64
- * `data-lightbox-href`: The URL that to be loaded into the lightbox. If not set, the link’s `href` attribute is used.
65
65
 
66
66
 
67
67
  ### Events
@@ -218,7 +218,7 @@ class ImageLighterBox extends LighterBox
218
218
 
219
219
  _loadContent: =>
220
220
  $.Deferred (deferred) =>
221
- href = @srcEl.attr("href")
221
+ href = @srcEl.data("lightbox-href") || @srcEl.attr("href")
222
222
  caption = @srcEl.data("lightbox-caption") || @srcEl.find("img").attr("alt") || ""
223
223
  newImg = $("<img>").attr(src: href).one "load", =>
224
224
  @modal.find("img").attr(src: newImg.attr("src"))
@@ -1,3 +1,3 @@
1
1
  module LighterBox
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0".freeze
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.4.0
4
+ version: 0.5.0
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-03-30 00:00:00.000000000 Z
11
+ date: 2017-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coffee-script