HEX
Server: Apache
System: Linux uws7-179.cafe24.com 3.10.0-1160.119.1p.el7.x86_64 #1 SMP Thu Sep 11 14:15:01 KST 2025 x86_64
User: medikors (1589)
PHP: 7.3.1p1
Disabled: mysql_pconnect
Upload Files
File: /medikors/www/wp-content/plugins/jet-engine/assets/js/admin/listings-popup.js
(function( $ ) {

	'use strict';

	var JetListings = {

		init: function() {

			var self = this;

			if ( window.JetListingsSettings && ! window.JetListingsSettings.hasElementor ) {
				if ( $( '.page-title-action' ).length ) {
					$( '.page-title-action' ).remove();
				}
			}

			$( document )
				.on( 'click.JetListings', '.page-title-action', self.openPopup )
				.on( 'click.JetListings', '.jet-listings-popup__overlay', self.closePopup )

			$( 'body' ).on( 'change', '#listing_source', self.switchListingSources );

		},

		switchListingSources: function( event ) {

			var $this = $( this ),
				val   = $this.find( 'option:selected' ).val(),
				$row  = $this.closest( '.jet-listings-popup__form-row' );

			$row.siblings( '.jet-template-listing' ).removeClass( 'jet-template-act' );
			$row.siblings( '.jet-template-' + val ).addClass( 'jet-template-act' );

		},

		openPopup: function( event ) {
			event.preventDefault();
			console.log( 'popup' );
			$( '.jet-listings-popup' ).addClass( 'jet-listings-popup-active' );
		},

		closePopup: function() {
			$( '.jet-listings-popup' ).removeClass( 'jet-listings-popup-active' );
		}

	};

	JetListings.init();

})( jQuery );