Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bulma-extensions

Package Overview
Dependencies
Maintainers
1
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bulma-extensions - npm Package Compare versions

Comparing version 0.6.7 to 0.6.8

38

bulma-carousel/carousel.js

@@ -14,18 +14,24 @@ const MOUSE_EVENTS = ['click', 'touchstart'];

MOUSE_EVENTS.forEach((event) => {
this.element.querySelector('.carousel-nav-left').addEventListener(event, (e) => {
e.preventDefault();
this.move('previous');
if (this.autoplayInterval) {
clearInterval(this.autoplayInterval);
this.autoPlay(this.element.dataset.delay || 5000);
}
}, false);
this.element.querySelector('.carousel-nav-right').addEventListener(event, (e) => {
e.preventDefault();
this.move('next');
if (this.autoplayInterval) {
clearInterval(this.autoplayInterval);
this.autoPlay(this.element.dataset.delay || 5000);
}
}, false);
let previousControl = this.element.querySelector('.carousel-nav-left');
let nextControl = this.element.querySelector('.carousel-nav-right');
if (previousControl) {
previousControl.addEventListener(event, (e) => {
e.preventDefault();
this.move('previous');
if (this.autoplayInterval) {
clearInterval(this.autoplayInterval);
this.autoPlay(this.element.dataset.delay || 5000);
}
}, false);
}
if (nextControl) {
nextControl.addEventListener(event, (e) => {
e.preventDefault();
this.move('next');
if (this.autoplayInterval) {
clearInterval(this.autoplayInterval);
this.autoPlay(this.element.dataset.delay || 5000);
}
}, false);
}
});

@@ -32,0 +38,0 @@

@@ -6,6 +6,6 @@ var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_";

$jscomp.polyfill("Array.from",function(a){return a?a:function(a,c,d){$jscomp.initSymbolIterator();c=null!=c?c:function(a){return a};var b=[],e=a[Symbol.iterator];if("function"==typeof e)for(a=e.call(a);!(e=a.next()).done;)b.push(c.call(d,e.value));else for(var e=a.length,g=0;g<e;g++)b.push(c.call(d,a[g]));return b}},"es6-impl","es3");var MOUSE_EVENTS=["click","touchstart"],Carousel=function(a){this.element=a;this.init()};
Carousel.prototype.init=function(){var a=this;this.items=Array.from(this.element.querySelectorAll(".carousel-item"));MOUSE_EVENTS.forEach(function(b){a.element.querySelector(".carousel-nav-left").addEventListener(b,function(b){b.preventDefault();a.move("previous");a.autoplayInterval&&(clearInterval(a.autoplayInterval),a.autoPlay(a.element.dataset.delay||5E3))},!1);a.element.querySelector(".carousel-nav-right").addEventListener(b,function(b){b.preventDefault();a.move("next");a.autoplayInterval&&(clearInterval(a.autoplayInterval),
a.autoPlay(a.element.dataset.delay||5E3))},!1)});this.initOrder();this.element.dataset.autoplay&&"true"==this.element.dataset.autoplay&&this.autoPlay(this.element.dataset.delay||5E3)};Carousel.prototype.initOrder=function(){var a=this.element.querySelector(".carousel-item.is-active");(a=this.items.indexOf(a))?this.items.push(this.items.splice(0,a)):this.items.unshift(this.items.pop());this.setOrder()};
Carousel.prototype.init=function(){var a=this;this.items=Array.from(this.element.querySelectorAll(".carousel-item"));MOUSE_EVENTS.forEach(function(b){var c=a.element.querySelector(".carousel-nav-left"),d=a.element.querySelector(".carousel-nav-right");c&&c.addEventListener(b,function(b){b.preventDefault();a.move("previous");a.autoplayInterval&&(clearInterval(a.autoplayInterval),a.autoPlay(a.element.dataset.delay||5E3))},!1);d&&d.addEventListener(b,function(b){b.preventDefault();a.move("next");a.autoplayInterval&&
(clearInterval(a.autoplayInterval),a.autoPlay(a.element.dataset.delay||5E3))},!1)});this.initOrder();this.element.dataset.autoplay&&"true"==this.element.dataset.autoplay&&this.autoPlay(this.element.dataset.delay||5E3)};Carousel.prototype.initOrder=function(){var a=this.element.querySelector(".carousel-item.is-active");(a=this.items.indexOf(a))?this.items.push(this.items.splice(0,a)):this.items.unshift(this.items.pop());this.setOrder()};
Carousel.prototype.setOrder=function(){this.items.forEach(function(a,b){a.style["z-index"]=1!==b?"0":"1";a.style.order=b})};
Carousel.prototype.move=function(a){a=void 0===a?"next":a;var b=this;this.items.length&&(this.element.querySelector(".carousel-item.is-active").classList.remove("is-active"),"previous"===a?(this.items.unshift(this.items.pop()),this.element.classList.add("is-reversing")):(this.items.push(this.items.shift()),this.element.classList.remove("is-reversing")),(1<=this.items.length?this.items[1]:this.items[0]).classList.add("is-active"),this.setOrder(),this.element.classList.toggle("carousel-animated"),setTimeout(function(){b.element.classList.toggle("carousel-animated")},
50))};Carousel.prototype.autoPlay=function(a){var b=this;this.autoplayInterval=setInterval(function(){b.move("next")},void 0===a?5E3:a)};document.addEventListener("DOMContentLoaded",function(){var a=document.querySelectorAll(".carousel, .hero-carousel");[].forEach.call(a,function(a){new Carousel(a)})});
{
"name": "bulma-carousel",
"version": "0.3.3",
"version": "0.3.4",
"description": "Display a Image / Content carousel",

@@ -5,0 +5,0 @@ "main": "carousel.sass",

{
"name": "bulma-extensions",
"version": "0.6.7",
"version": "0.6.8",
"description": "Set of extensions for Bulma.io CSS Framework",

@@ -5,0 +5,0 @@ "main": "extensions.sass",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc