HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.60.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 5 05:00:59 EST 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: /home/barbeatleanalyti/www/public_html/webmail/modules/CoreWebclient/js/popups/CAbstractPopup.js
'use strict';

var
	_ = require('underscore'),
	ko = require('knockout'),
	
	Popups = require('%PathToCoreWebclientModule%/js/Popups.js')
;

function CAbstractPopup()
{
	this.opened = ko.observable(false);
	this.$popupDom = null;
}

CAbstractPopup.prototype.PopupTemplate = '';

CAbstractPopup.prototype.openPopup = function (aParameters)
{
	if (this.$popupDom && !this.opened())
	{
		this.showPopup();

		Popups.addPopup(this);
	}
		
	this.onOpen.apply(this, aParameters);
};

CAbstractPopup.prototype.closePopup = function ()
{
	if (this.$popupDom && this.opened())
	{
		this.hidePopup();
		
		Popups.removePopup(this);
		
		this.onClose();
	}
};

CAbstractPopup.prototype.showPopup = function ()
{
	if (this.$popupDom && !this.opened())
	{
		this.$popupDom.show();

		this.opened(true);

		_.delay(_.bind(function() {
			this.$popupDom.addClass('visible');
		}, this), 50);
		
		this.onShow();
	}
};

CAbstractPopup.prototype.hidePopup = function ()
{
	if (this.$popupDom && this.opened())
	{
		this.$popupDom.hide();
		
		this.opened(false);
		
		this.$popupDom.removeClass('visible').hide();
		
		this.onHide();
	}
};

CAbstractPopup.prototype.cancelPopup = function ()
{
	this.closePopup();
};

CAbstractPopup.prototype.onEscHandler = function (oEvent)
{
	this.cancelPopup();
};

CAbstractPopup.prototype.onEnterHandler = function ()
{
};

CAbstractPopup.prototype.onBind = function ()
{
};

CAbstractPopup.prototype.onOpen = function ()
{
};

CAbstractPopup.prototype.onClose = function ()
{
};

CAbstractPopup.prototype.onShow = function ()
{
};

CAbstractPopup.prototype.onHide = function ()
{
};

CAbstractPopup.prototype.onRoute = function (aParams)
{
};

module.exports = CAbstractPopup;