Documentation

Sidepanel customization

Slider display is processed separately from the site template where it is shown. Slider display parameters can be modified for a specific site template, as well as customize conflicting design elements. JavaScript-class must be created that inherits BX.SidePanel.Slider and the corresponding methods must be re-defined.

(function() {

"use strict";

BX.namespace("BX.MyModule.Slider");

BX.MyModule.Slider = function(url, options)
{
	BX.SidePanel.Slider.apply(this, arguments);
};

BX.MyModule.Slider.prototype =
{
	__proto__: BX.SidePanel.Slider.prototype,
	constructor: BX.MyModule.Slider,

	/**
	 * @public
	 * @returns {void}
	 */
	applyHacks: function()
	{
		//Code, that configures conflicting design elements
		//Method is called before disabling the page scrolling
	},

	/**
	 * @public
	 * @returns {void}
	 */
	applyPostHacks: function()
	{
		//Code, that configures conflicting design elements
		//Method is called after disabling the page scrolling
	},

	/**
	 * @public
	 * @returns {void}
	 */
	resetHacks: function()
	{
		//Method to reset settings, which were applied in applyHacks
	},

	/**
	 * @public
	 * @returns {void}
	 */
	resetPostHacks: function()
	{
		//Method to reset settings which were applied in applyPostHacks
	},

	/**
	 * @public
	 * @returns {number}
	 */
	getTopBoundary: function()
	{
		//Defines the upper limit (coordinate) of the slider
		return 0;
	},

	/**
	 * @public
	 * @returns {number}
	 */
	getLeftBoundary: function()
	{
		//Defines the left limit (coordinate) of the slider
		return 200;
	},

	/**
	 * @public
	 * @returns {number}
	 */
	getRightBoundary: function()
	{
		//Defines the right limit (coordinate) of the slider
        return 0;
	}
};

})();

After that, the created class must be registered.

BX.SidePanel.Manager.registerSliderClass("BX.MyModule.Slider");


© «Bitrix24», 2001-2024
Up