HEX
Server: Apache/2.4.65 (Debian)
System: Linux wordpress-7cb4c6b6f6-qgbk2 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64
User: www-data (33)
PHP: 8.3.27
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/plugins/Crocoblock-wizard/assets/js/slides.js
(function () {

	"use strict";

	Vue.component( 'cbw-slides', {
		template: '#cbw_slides',
		data: function() {
			return {
				slides: [],
				slider: false,
				autoplay: 15000,
				autoplayInterval: false,
			};
		},
		mounted: function() {

			var self = this;

			jQuery.ajax({
				url: window.CBWPageConfig.slides_url,
				type: 'GET',
				dataType: 'json',
			}).done( function( response ) {
				self.slides = response;
				self.$nextTick( function() {
					self.slider = new Siema({
						loop: true,
						duration: 500,
					});
				} );

				self.setAutoplay();
			});

		},
		methods: {
			setAutoplay: function() {

				var self = this;

				self.autoplayInterval = setInterval( function() {
					if ( self.slider ) {
						self.slider.next();
					}
				}, self.autoplay );

			},
			resetAutoplay: function() {
				clearInterval( this.autoplayInterval );
				this.setAutoplay();
			}
		}
	} );

})();