Learn more  » Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

jsarnowski / jsarnowski/jet-smart-filters   php

Repository URL to install this package:

Version: 2.2.1 

/ src / js / index.js

import filtersInitializer from './filters-initializer';

// Includes
import elementorEditorMode from 'includes/elementor-editor-mode';
import eproCompat from 'includes/epro-compat';

"use strict";

//JetSmartFilters
window.JetSmartFilters = filtersInitializer;

// Init filters
$(document).ready(function () {
	window.JetSmartFilters.initializeFilters();

	//console.log(window.JetSmartFilters);
});

// if elementor
$(window).on('elementor/frontend/init', function () {
	// initialize elementor PRO widgets post rendered processing
	eproCompat.init();

	// edit mode filters init
	if (elementorFrontend.isEditMode())
		elementorEditorMode.initFilters();
});

// Reinit filters events
$(window)
	.on('jet-popup/render-content/ajax/success', function (evt, popup) {
		window.JetSmartFilters.initializeFiltersInContainer($('#jet-popup-' + popup.popup_id));
	})
	.on('jet-tabs/ajax-load-template/after', function (evt, props) {
		window.JetSmartFilters.initializeFiltersInContainer(props.contentHolder);
	})
	.on('jet-blocks/ajax-load-template/after', function (evt, props) {
		window.JetSmartFilters.initializeFiltersInContainer(props.contentHolder);
	});