HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux wordpress-ubuntu-s-2vcpu-4gb-fra1-01 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64
User: root (0)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/lipovac/wp-content/plugins/js_composer/assets/js/components/vc_grid_style_all.js
/* =========================================================
 * vc_grid_style_all.js v1.0
 * =========================================================
 * Copyright 2014 Wpbakery
 *
 * Basic Grid Style show all
 * ========================================================= */
var vcGridStyleAll;
(function ( $ ) {
	/**
	 * "Show all items" grid style.
	 * ==============================
	 *
	 * @param grid
	 * @constructor
	 */
	vcGridStyleAll = function ( grid ) {
		this.grid = grid;
		this.settings = grid.settings;
		this.filterValue = null;
		this.$el = false;
		this.$content = false;
		this.isLoading = false;
		this.$loader = $( '<div class="vc_grid-loading"></div>' );
		this.init();
	};
	/**
	 * Initialize
	 */
	vcGridStyleAll.prototype.init = function () {
		_.bindAll( this
			, 'addItems'
			, 'showItems'
		);
	};
	/**
	 * Build required content and data.
	 */
	vcGridStyleAll.prototype.render = function () {
		this.$el = this.grid.$el;
		this.$content = this.$el;
		this.setIsLoading();
		this.grid.ajax( {}, this.addItems );
	};
	vcGridStyleAll.prototype.setIsLoading = function () {
		this.$content.append( this.$loader );
		this.isLoading = true;
	};

	vcGridStyleAll.prototype.unsetIsLoading = function () {
		this.isLoading = false;
		this.$loader && this.$loader.remove();
	};
	/**
	 * Filter function called by grid object ot filter content.
	 *
	 * @param filter - string parameter with filter settings.
	 */
	vcGridStyleAll.prototype.filter = function ( filter ) {
		filter = _.isUndefined( filter ) || filter === '*' ? '' : filter;
		if ( this.filterValue == filter ) {
			return false; // already filtred
		}
		this.$content
			.find( '.vc_visible-item' )
			.removeClass( 'vc_visible-item ' + vcGridSettings.addItemsAnimation + ' animated' );
		this.filterValue = filter;
		_.defer( this.showItems ); // just only for animation
	};
	vcGridStyleAll.prototype.showItems = function () {
		var $els = this.$content.find( '.vc_grid-item' + this.filterValue );
		this.setIsLoading();
		$els.addClass( 'vc_visible-item ' + (
			vcGridSettings.addItemsAnimation != 'none' ? vcGridSettings.addItemsAnimation + ' animated' : '') );
		this.unsetIsLoading();
	};
	/**
	 * Add new grid elements to content block. Called by ajax in render method.
	 * @param html
	 */
	vcGridStyleAll.prototype.addItems = function ( html ) {
		this.unsetIsLoading();
		$( html ).appendTo( this.$el );
		this.$content = this.$el.find( '[data-vc-grid-content="true"]' );
		this.grid.initFilter();
		this.filter();
		window.vc_prettyPhoto();
		return false;
	};
})( window.jQuery );