diff --git a/dist/Drift.js b/dist/Drift.js index 52ea9bb1..2c9b4909 100644 --- a/dist/Drift.js +++ b/dist/Drift.js @@ -144,7 +144,7 @@ module.exports = function () { _classCallCheck(this, Drift); - this.VERSION = '0.3.1'; + this.VERSION = '0.3.2'; this.destroy = function () { _this.trigger._unbindEvents(); diff --git a/dist/Drift.min.js b/dist/Drift.min.js index 4d09cd32..8c8582bb 100644 --- a/dist/Drift.min.js +++ b/dist/Drift.min.js @@ -1 +1 @@ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Drift=e()}}(function(){return function e(t,n,i){function s(l,a){if(!n[l]){if(!t[l]){var r="function"==typeof require&&require;if(!a&&r)return r(l,!0);if(o)return o(l,!0);var h=new Error("Cannot find module '"+l+"'");throw h.code="MODULE_NOT_FOUND",h}var u=n[l]={exports:{}};t[l][0].call(u.exports,function(e){var n=t[l][1][e];return s(n?n:e)},u,u.exports,e,t,n,i)}return n[l].exports}for(var o="function"==typeof require&&require,l=0;ln.left+n.width+i&&(o=n.left+n.width-this.el.clientWidth+i),ln.top+n.height+s&&(l=n.top+n.height-this.el.clientHeight+s),this.el.style.left=o+"px",this.el.style.top=l+"px"}}]),e}();n["default"]=h},{"./util/dom":6,"./util/throwIfMissing":7}],2:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;nn.left+n.width+a&&(h=n.left+n.width-this.el.clientWidth+a),un.top+n.height+r&&(u=n.top+n.height-this.el.clientHeight+r)}this.el.style.left=h+"px",this.el.style.top=u+"px"}this.settings.showWhitespaceAtEdges||(i>0?i=0:o>i&&(i=o),s>0?s=0:l>s&&(s=l)),this.imgEl.style.transform="translate("+i+"px, "+s+"px)",this.imgEl.style.webkitTransform="translate("+i+"px, "+s+"px)"}},{key:"_removeListenersAndResetClasses",value:function(){this.el.removeEventListener("animationend",this._completeShow,!1),this.el.removeEventListener("animationend",this._completeHide,!1),this.el.removeEventListener("webkitAnimationEnd",this._completeShow,!1),this.el.removeEventListener("webkitAnimationEnd",this._completeHide,!1),(0,r.removeClasses)(this.el,this.openClasses),(0,r.removeClasses)(this.el,this.closingClasses)}},{key:"show",value:function(e,t,n){this._removeListenersAndResetClasses(),this.isShowing=!0,(0,r.addClasses)(this.el,this.openClasses),this._setImageURL(e),this._setImageSize(t,n),this._isInline?this._showInline():this._showInContainer(),u&&(this.el.addEventListener("animationend",this._completeShow,!1),this.el.addEventListener("webkitAnimationEnd",this._completeShow,!1),(0,r.addClasses)(this.el,this.openingClasses))}},{key:"_showInline",value:function(){this.settings.inlineContainer.appendChild(this.el),(0,r.addClasses)(this.el,this.inlineClasses)}},{key:"_showInContainer",value:function(){this.settings.container.appendChild(this.el)}},{key:"hide",value:function(){this._removeListenersAndResetClasses(),this.isShowing=!1,u?(this.el.addEventListener("animationend",this._completeHide,!1),this.el.addEventListener("webkitAnimationEnd",this._completeHide,!1),(0,r.addClasses)(this.el,this.closingClasses)):((0,r.removeClasses)(this.el,this.openClasses),(0,r.removeClasses)(this.el,this.inlineClasses))}},{key:"_isInline",get:function(){var e=this.settings.inline;return e===!0||"number"==typeof e&&window.innerWidth<=e}}]),e}();n["default"]=d},{"./util/dom":6,"./util/throwIfMissing":7}],5:[function(e,t,n){"use strict";function i(){if(!document.querySelector(".drift-base-styles")){var e=document.createElement("style");e.type="text/css",e.classList.add("drift-base-styles"),e.appendChild(document.createTextNode(s));var t=document.head;t.insertBefore(e,t.firstChild)}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=i;var s="\n@keyframes noop {\n 0% { zoom: 1; }\n}\n\n@-webkit-keyframes noop {\n 0% { zoom: 1; }\n}\n\n.drift-zoom-pane.drift-open {\n display: block;\n}\n\n.drift-zoom-pane.drift-opening, .drift-zoom-pane.drift-closing {\n animation: noop 1ms;\n -webkit-animation: noop 1ms;\n}\n\n.drift-zoom-pane {\n position: absolute;\n overflow: hidden;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n pointer-events: none;\n}\n\n.drift-zoom-pane-loader {\n display: none;\n}\n\n.drift-zoom-pane img {\n position: absolute;\n display: block;\n}\n\n.drift-bounding-box {\n position: absolute;\n pointer-events: none;\n}\n"},{}],6:[function(e,t,n){"use strict";function i(e){return a?e instanceof HTMLElement:e&&"object"===("undefined"==typeof e?"undefined":l(e))&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName}function s(e,t){t.forEach(function(t){e.classList.add(t)})}function o(e,t){t.forEach(function(t){e.classList.remove(t)})}Object.defineProperty(n,"__esModule",{value:!0});var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};n.isDOMElement=i,n.addClasses=s,n.removeClasses=o;var a="object"===("undefined"==typeof HTMLElement?"undefined":l(HTMLElement))},{}],7:[function(e,t,n){"use strict";function i(){throw new Error("Missing parameter")}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=i},{}]},{},[2])(2)}); \ No newline at end of file +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Drift=e()}}(function(){return function e(t,n,i){function s(l,a){if(!n[l]){if(!t[l]){var r="function"==typeof require&&require;if(!a&&r)return r(l,!0);if(o)return o(l,!0);var h=new Error("Cannot find module '"+l+"'");throw h.code="MODULE_NOT_FOUND",h}var u=n[l]={exports:{}};t[l][0].call(u.exports,function(e){var n=t[l][1][e];return s(n?n:e)},u,u.exports,e,t,n,i)}return n[l].exports}for(var o="function"==typeof require&&require,l=0;ln.left+n.width+i&&(o=n.left+n.width-this.el.clientWidth+i),ln.top+n.height+s&&(l=n.top+n.height-this.el.clientHeight+s),this.el.style.left=o+"px",this.el.style.top=l+"px"}}]),e}();n["default"]=h},{"./util/dom":6,"./util/throwIfMissing":7}],2:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;nn.left+n.width+a&&(h=n.left+n.width-this.el.clientWidth+a),un.top+n.height+r&&(u=n.top+n.height-this.el.clientHeight+r)}this.el.style.left=h+"px",this.el.style.top=u+"px"}this.settings.showWhitespaceAtEdges||(i>0?i=0:o>i&&(i=o),s>0?s=0:l>s&&(s=l)),this.imgEl.style.transform="translate("+i+"px, "+s+"px)",this.imgEl.style.webkitTransform="translate("+i+"px, "+s+"px)"}},{key:"_removeListenersAndResetClasses",value:function(){this.el.removeEventListener("animationend",this._completeShow,!1),this.el.removeEventListener("animationend",this._completeHide,!1),this.el.removeEventListener("webkitAnimationEnd",this._completeShow,!1),this.el.removeEventListener("webkitAnimationEnd",this._completeHide,!1),(0,r.removeClasses)(this.el,this.openClasses),(0,r.removeClasses)(this.el,this.closingClasses)}},{key:"show",value:function(e,t,n){this._removeListenersAndResetClasses(),this.isShowing=!0,(0,r.addClasses)(this.el,this.openClasses),this._setImageURL(e),this._setImageSize(t,n),this._isInline?this._showInline():this._showInContainer(),u&&(this.el.addEventListener("animationend",this._completeShow,!1),this.el.addEventListener("webkitAnimationEnd",this._completeShow,!1),(0,r.addClasses)(this.el,this.openingClasses))}},{key:"_showInline",value:function(){this.settings.inlineContainer.appendChild(this.el),(0,r.addClasses)(this.el,this.inlineClasses)}},{key:"_showInContainer",value:function(){this.settings.container.appendChild(this.el)}},{key:"hide",value:function(){this._removeListenersAndResetClasses(),this.isShowing=!1,u?(this.el.addEventListener("animationend",this._completeHide,!1),this.el.addEventListener("webkitAnimationEnd",this._completeHide,!1),(0,r.addClasses)(this.el,this.closingClasses)):((0,r.removeClasses)(this.el,this.openClasses),(0,r.removeClasses)(this.el,this.inlineClasses))}},{key:"_isInline",get:function(){var e=this.settings.inline;return e===!0||"number"==typeof e&&window.innerWidth<=e}}]),e}();n["default"]=d},{"./util/dom":6,"./util/throwIfMissing":7}],5:[function(e,t,n){"use strict";function i(){if(!document.querySelector(".drift-base-styles")){var e=document.createElement("style");e.type="text/css",e.classList.add("drift-base-styles"),e.appendChild(document.createTextNode(s));var t=document.head;t.insertBefore(e,t.firstChild)}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=i;var s="\n@keyframes noop {\n 0% { zoom: 1; }\n}\n\n@-webkit-keyframes noop {\n 0% { zoom: 1; }\n}\n\n.drift-zoom-pane.drift-open {\n display: block;\n}\n\n.drift-zoom-pane.drift-opening, .drift-zoom-pane.drift-closing {\n animation: noop 1ms;\n -webkit-animation: noop 1ms;\n}\n\n.drift-zoom-pane {\n position: absolute;\n overflow: hidden;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n pointer-events: none;\n}\n\n.drift-zoom-pane-loader {\n display: none;\n}\n\n.drift-zoom-pane img {\n position: absolute;\n display: block;\n}\n\n.drift-bounding-box {\n position: absolute;\n pointer-events: none;\n}\n"},{}],6:[function(e,t,n){"use strict";function i(e){return a?e instanceof HTMLElement:e&&"object"===("undefined"==typeof e?"undefined":l(e))&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName}function s(e,t){t.forEach(function(t){e.classList.add(t)})}function o(e,t){t.forEach(function(t){e.classList.remove(t)})}Object.defineProperty(n,"__esModule",{value:!0});var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};n.isDOMElement=i,n.addClasses=s,n.removeClasses=o;var a="object"===("undefined"==typeof HTMLElement?"undefined":l(HTMLElement))},{}],7:[function(e,t,n){"use strict";function i(){throw new Error("Missing parameter")}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=i},{}]},{},[2])(2)}); \ No newline at end of file diff --git a/package.json b/package.json index 9fa00556..6fd8e4fc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "drift-zoom", - "version": "0.3.1", + "version": "0.3.2", "description": "Easily add \"zoom on hover\" functionality to your site's images. Lightweight, no-dependency JavaScript.", "main": "dist/Drift.js", "scripts": { diff --git a/src/js/Drift.js b/src/js/Drift.js index 2d58c593..3848907b 100644 --- a/src/js/Drift.js +++ b/src/js/Drift.js @@ -5,7 +5,7 @@ import Trigger from './Trigger'; import ZoomPane from './ZoomPane'; module.exports = class Drift { - VERSION = '0.3.1' + VERSION = '0.3.2' constructor(triggerEl, options = {}) { this.triggerEl = triggerEl;