bulma-extensions
Advanced tools
Comparing version 0.7.14 to 0.7.15
@@ -0,1 +1,11 @@ | ||
<a name="0.3.9"></a> | ||
## [0.3.9](https://github.com/Wikiki/bulma-carousel/compare/0.3.8...0.3.9) (2018-02-10) | ||
### Bug Fixes | ||
* **swipe:** Set image draggable attribute to false ([4262599](https://github.com/Wikiki/bulma-carousel/commit/4262599)) | ||
<a name="0.3.8"></a> | ||
@@ -2,0 +12,0 @@ ## [0.3.8](https://github.com/Wikiki/bulma-carousel/compare/0.3.7...0.3.8) (2018-02-10) |
@@ -22,2 +22,6 @@ export default class Carousel { | ||
this.items = Array.from(this.element.querySelectorAll('.carousel-item')); | ||
this.items.forEach((item) => { | ||
let img = item.querySelector('img'); | ||
img.setAttribute('draggable', false); | ||
}); | ||
this.computedStyle = window.getComputedStyle(this.element); | ||
@@ -24,0 +28,0 @@ |
@@ -1,1 +0,1 @@ | ||
"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var i=0;i<t.length;i++){var s=t[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function _createClass(e,t,i){return t&&_defineProperties(e.prototype,t),i&&_defineProperties(e,i),e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var Carousel=function(){function e(t){if(_classCallCheck(this,e),this._clickEvent="ontouchstart"in window?"touchstart":"click",this.element="string"==typeof t?document.querySelector(t):t,!this.element)throw new Error("An invalid selector or non-DOM node has been provided.");this.init()}return _createClass(e,[{key:"init",value:function(){this.items=Array.from(this.element.querySelectorAll(".carousel-item")),this.computedStyle=window.getComputedStyle(this.element),this.previousControl=this.element.querySelector(".carousel-nav-left"),this.nextControl=this.element.querySelector(".carousel-nav-right"),this._bindEvents(),this._initOrder(),this.element.dataset._autoPlay&&"true"==this.element.dataset._autoPlay&&this._autoPlay(this.element.dataset.delay||5e3)}},{key:"_bindEvents",value:function(){var e=this;this.previousControl&&this.previousControl.addEventListener(this._clickEvent,function(t){t.preventDefault(),e._slide("previous"),e._autoPlayInterval&&(clearInterval(e._autoPlayInterval),e._autoPlay(e.element.dataset.delay||5e3))},!1),this.nextControl&&this.nextControl.addEventListener(this._clickEvent,function(t){t.preventDefault(),e._slide("next"),e._autoPlayInterval&&(clearInterval(e._autoPlayInterval),e._autoPlay(e.element.dataset.delay||5e3))},!1),this.element.addEventListener("touchstart",function(t){e._swipeStart(t)}),this.element.addEventListener("mousedown",function(t){e._swipeStart(t)}),this.element.addEventListener("touchend",function(t){e._swipeEnd(t)}),this.element.addEventListener("mouseup",function(t){e._swipeEnd(t)})}},{key:"_initOrder",value:function(){var e=this.element.querySelector(".carousel-item.is-active"),t=this.items.indexOf(e);this.items.length;t?this.items.push(this.items.splice(0,t)):this.items.unshift(this.items.pop()),this._setOrder()}},{key:"_setOrder",value:function(){this.items.forEach(function(e,t){e.style["z-index"]=1!==t?"0":"1",e.style.order=t})}},{key:"_swipeStart",value:function(e){this._touch={start:{x:e.clientX,y:e.clientY},end:{x:e.clientX,y:e.clientY}}}},{key:"_swipeEnd",value:function(e){this._touch.end={x:e.clientX,y:e.clientY},this._handleGesture()}},{key:"_handleGesture",value:function(){var e=(this._touch.end.x-this._touch.start.x)/parseInt(this.computedStyle.getPropertyValue("width")),t=(this._touch.end.y-this._touch.start.y)/parseInt(this.computedStyle.getPropertyValue("height"));e>t&&e>.25&&this._slide("previous"),e<t&&e<-.25&&this._slide("next")}},{key:"_slide",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"next";this.items.length&&(this.element.querySelector(".carousel-item.is-active").classList.remove("is-active"),"previous"===t?(this.items.unshift(this.items.pop()),this.element.classList.add("is-reversing")):(this.items.push(this.items.shift()),this.element.classList.remove("is-reversing")),(this.items.length>=1?this.items[1]:this.items[0]).classList.add("is-active"),this._setOrder(),this.element.classList.toggle("carousel-animated"),setTimeout(function(){e.element.classList.toggle("carousel-animated")},50))}},{key:"_autoPlay",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5e3;this._autoPlayInterval=setInterval(function(){e._slide("next")},t)}}]),e}();exports.default=Carousel,document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll(".carousel, .hero-carousel");[].forEach.call(e,function(e){new Carousel(e)})}); | ||
"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var i=0;i<t.length;i++){var s=t[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function _createClass(e,t,i){return t&&_defineProperties(e.prototype,t),i&&_defineProperties(e,i),e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var Carousel=function(){function e(t){if(_classCallCheck(this,e),this._clickEvent="ontouchstart"in window?"touchstart":"click",this.element="string"==typeof t?document.querySelector(t):t,!this.element)throw new Error("An invalid selector or non-DOM node has been provided.");this.init()}return _createClass(e,[{key:"init",value:function(){this.items=Array.from(this.element.querySelectorAll(".carousel-item")),this.items.forEach(function(e){e.querySelector("img").setAttribute("draggable",!1)}),this.computedStyle=window.getComputedStyle(this.element),this.previousControl=this.element.querySelector(".carousel-nav-left"),this.nextControl=this.element.querySelector(".carousel-nav-right"),this._bindEvents(),this._initOrder(),this.element.dataset._autoPlay&&"true"==this.element.dataset._autoPlay&&this._autoPlay(this.element.dataset.delay||5e3)}},{key:"_bindEvents",value:function(){var e=this;this.previousControl&&this.previousControl.addEventListener(this._clickEvent,function(t){t.preventDefault(),e._slide("previous"),e._autoPlayInterval&&(clearInterval(e._autoPlayInterval),e._autoPlay(e.element.dataset.delay||5e3))},!1),this.nextControl&&this.nextControl.addEventListener(this._clickEvent,function(t){t.preventDefault(),e._slide("next"),e._autoPlayInterval&&(clearInterval(e._autoPlayInterval),e._autoPlay(e.element.dataset.delay||5e3))},!1),this.element.addEventListener("touchstart",function(t){e._swipeStart(t)}),this.element.addEventListener("mousedown",function(t){e._swipeStart(t)}),this.element.addEventListener("touchend",function(t){e._swipeEnd(t)}),this.element.addEventListener("mouseup",function(t){e._swipeEnd(t)})}},{key:"_initOrder",value:function(){var e=this.element.querySelector(".carousel-item.is-active"),t=this.items.indexOf(e);this.items.length;t?this.items.push(this.items.splice(0,t)):this.items.unshift(this.items.pop()),this._setOrder()}},{key:"_setOrder",value:function(){this.items.forEach(function(e,t){e.style["z-index"]=1!==t?"0":"1",e.style.order=t})}},{key:"_swipeStart",value:function(e){this._touch={start:{x:e.clientX,y:e.clientY},end:{x:e.clientX,y:e.clientY}}}},{key:"_swipeEnd",value:function(e){this._touch.end={x:e.clientX,y:e.clientY},this._handleGesture()}},{key:"_handleGesture",value:function(){var e=(this._touch.end.x-this._touch.start.x)/parseInt(this.computedStyle.getPropertyValue("width")),t=(this._touch.end.y-this._touch.start.y)/parseInt(this.computedStyle.getPropertyValue("height"));e>t&&e>.25&&this._slide("previous"),e<t&&e<-.25&&this._slide("next")}},{key:"_slide",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"next";this.items.length&&(this.element.querySelector(".carousel-item.is-active").classList.remove("is-active"),"previous"===t?(this.items.unshift(this.items.pop()),this.element.classList.add("is-reversing")):(this.items.push(this.items.shift()),this.element.classList.remove("is-reversing")),(this.items.length>=1?this.items[1]:this.items[0]).classList.add("is-active"),this._setOrder(),this.element.classList.toggle("carousel-animated"),setTimeout(function(){e.element.classList.toggle("carousel-animated")},50))}},{key:"_autoPlay",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5e3;this._autoPlayInterval=setInterval(function(){e._slide("next")},t)}}]),e}();exports.default=Carousel,document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll(".carousel, .hero-carousel");[].forEach.call(e,function(e){new Carousel(e)})}); |
{ | ||
"name": "bulma-carousel", | ||
"version": "0.3.8", | ||
"version": "0.3.9", | ||
"description": "Display a Image / Content carousel", | ||
@@ -5,0 +5,0 @@ "main": "dist/bulma-carousel.sass", |
@@ -0,1 +1,20 @@ | ||
<a name="0.7.15"></a> | ||
## [0.7.15](https://github.com/Wikiki/bulma-extensions/compare/v0.7.7...v0.7.15) (2018-02-10) | ||
### Bug Fixes | ||
* **bower:** Add missing version ([9c2f5cd](https://github.com/Wikiki/bulma-extensions/commit/9c2f5cd)) | ||
* **gulp:** Correct ddist filenames ([f355b58](https://github.com/Wikiki/bulma-extensions/commit/f355b58)) | ||
* **package:** Correct file paths ([4d9cd49](https://github.com/Wikiki/bulma-extensions/commit/4d9cd49)) | ||
* **package.json:** Update dev dependencies ([4c05742](https://github.com/Wikiki/bulma-extensions/commit/4c05742)) | ||
* **travis:** Remove Travis CI ([a577814](https://github.com/Wikiki/bulma-extensions/commit/a577814)) | ||
### Features | ||
* **gulp:** Add release task ([5013f94](https://github.com/Wikiki/bulma-extensions/commit/5013f94)) | ||
<a name="0.7.14"></a> | ||
@@ -2,0 +21,0 @@ ## [0.7.14](https://github.com/Wikiki/bulma-extensions/compare/0.7.13...0.7.14) (2018-02-10) |
{ | ||
"name": "bulma-extensions", | ||
"version": "0.7.14", | ||
"version": "0.7.15", | ||
"description": "Set of extensions for Bulma.io CSS Framework", | ||
@@ -5,0 +5,0 @@ "main": "dist/bulma-extensions.sass", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
533469
1059