From 8ed665e0044a3c4ee0e04480d42895a7c7b1ffb2 Mon Sep 17 00:00:00 2001 From: Paul Straw Date: Fri, 8 Jan 2016 13:13:36 -0800 Subject: [PATCH 1/2] Fix HAS_ANIMATION bug when loaded before body Closes #4 --- dist/luminous.js | 2 +- dist/luminous.min.js | 2 +- index.html | 2 +- src/js/Lightbox.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/luminous.js b/dist/luminous.js index 9ee81cd8..8111e202 100644 --- a/dist/luminous.js +++ b/dist/luminous.js @@ -19,7 +19,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons // All officially-supported browsers have this, but it's easy to // account for, just in case. -var HAS_ANIMATION = 'animation' in document.body.style; +var HAS_ANIMATION = 'animation' in document.createElement('div').style; var Lightbox = (function () { function Lightbox() { diff --git a/dist/luminous.min.js b/dist/luminous.min.js index 925b0ee8..55b5c11b 100644 --- a/dist/luminous.min.js +++ b/dist/luminous.min.js @@ -1 +1 @@ -!function e(t,n,i){function s(l,r){if(!n[l]){if(!t[l]){var a="function"==typeof require&&require;if(!r&&a)return a(l,!0);if(o)return o(l,!0);var u=new Error("Cannot find module '"+l+"'");throw u.code="MODULE_NOT_FOUND",u}var d=n[l]={exports:{}};t[l][0].call(d.exports,function(e){var n=t[l][1][e];return s(n?n:e)},d,d.exports,e,t,n,i)}return n[l].exports}for(var o="function"==typeof require&&require,l=0;l + @@ -69,7 +70,6 @@

Luminous Demo

imgix - diff --git a/src/js/Lightbox.js b/src/js/Lightbox.js index 2ba3c244..7b76c85a 100644 --- a/src/js/Lightbox.js +++ b/src/js/Lightbox.js @@ -3,7 +3,7 @@ import throwIfMissing from './util/throwIfMissing'; // All officially-supported browsers have this, but it's easy to // account for, just in case. -const HAS_ANIMATION = 'animation' in document.body.style; +const HAS_ANIMATION = 'animation' in document.createElement('div').style; export default class Lightbox { constructor(options = {}) { From 87d06aeccf4996c158105a6127433568c73ac46b Mon Sep 17 00:00:00 2001 From: Paul Straw Date: Fri, 8 Jan 2016 13:14:33 -0800 Subject: [PATCH 2/2] Version bump to 0.1.3 --- dist/luminous.js | 2 +- dist/luminous.min.js | 2 +- index.html | 2 +- package.json | 2 +- src/js/Luminous.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dist/luminous.js b/dist/luminous.js index 8111e202..29dad155 100644 --- a/dist/luminous.js +++ b/dist/luminous.js @@ -182,7 +182,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -var VERSION = exports.VERSION = '0.1.2'; +var VERSION = exports.VERSION = '0.1.3'; var Luminous = (function () { function Luminous(trigger) { diff --git a/dist/luminous.min.js b/dist/luminous.min.js index 55b5c11b..0095a44c 100644 --- a/dist/luminous.min.js +++ b/dist/luminous.min.js @@ -1 +1 @@ -!function e(t,n,i){function s(l,r){if(!n[l]){if(!t[l]){var a="function"==typeof require&&require;if(!r&&a)return a(l,!0);if(o)return o(l,!0);var u=new Error("Cannot find module '"+l+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[l]={exports:{}};t[l][0].call(c.exports,function(e){var n=t[l][1][e];return s(n?n:e)},c,c.exports,e,t,n,i)}return n[l].exports}for(var o="function"==typeof require&&require,l=0;l - @@ -70,6 +69,7 @@

Luminous Demo

imgix + diff --git a/package.json b/package.json index e9d21878..8afef5f7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "luminous-lightbox", - "version": "0.1.2", + "version": "0.1.3", "description": "A simple, lightweight, no-dependencies JavaScript image lightbox.", "main": "index.js", "scripts": { diff --git a/src/js/Luminous.js b/src/js/Luminous.js index 4d2bd8e1..f70afc66 100644 --- a/src/js/Luminous.js +++ b/src/js/Luminous.js @@ -2,7 +2,7 @@ import { isDOMElement } from './util/dom'; import injectBaseStylesheet from './injectBaseStylesheet'; import Lightbox from './Lightbox'; -export const VERSION = '0.1.2'; +export const VERSION = '0.1.3'; export default class Luminous { constructor(trigger, options = {}) {