HEX
Server: Apache
System: Linux ecngx285.inmotionhosting.com 4.18.0-553.79.1.lve.el8.x86_64 #1 SMP Wed Oct 15 17:59:35 UTC 2025 x86_64
User: zeusxp5 (3862)
PHP: 8.3.28
Disabled: NONE
Upload Files
File: /home/zeusxp5/chuair.org/wp-content/plugins/post-and-page-builder/assets/js/view/loading/element.js
import './style.scss';
import loadingGraphic from '../../../../assets/image/boldgrid-logo.svg';

export class Element {

	/**
	 * Show the loading element.
	 *
	 * @since 1.9.0
	 */
	show() {
		this._getElement().show();
	}

	/**
	 * Hide the loading element.
	 *
	 * @since 1.9.0
	 */
	hide() {
		this._getElement().hide();
	}

	/**
	 * Get the loading element.
	 *
	 * @since 1.9.0
	 *
	 * @return {$} Loading Element.
	 */
	_getElement() {
		if ( ! this.$element ) {
			this.$element = $( this._getHTML() );
			$( 'body' ).append( this.$element );
		}

		return this.$element;
	}

	/**
	 * Get the HTML needed for the loading graphic.
	 *
	 * @since 1.9.0
	 *
	 * @return {string} Page markup.
	 */
	_getHTML() {
		return `
			<div class="bgppb-page-loading">
				<span class="bgppb-page-loading__logo">${loadingGraphic}</span>
				<span class="bgppb-page-loading__spinner"></span>
			</div>
		`;
	}
}