%PDF- %PDF-
Server IP : 37.220.80.31 / Your IP : 18.218.153.50 Web Server : Apache/2.4.52 (Ubuntu) System : Linux 3051455-guretool.twc1.net 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64 User : www-root ( 1010) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/components/bitrix/landing.demo/templates/.default/ |
Upload File : |
(function() { 'use strict'; BX.namespace('BX.Landing.Component'); BX.Landing.Component.Demo = function(options) { this.wrapper = options.wrapper; this.inner = options.inner; this.tiles = options.tiles; this.isShow = false; this.startHeight = 0; this.innerBlock = null; this.handleMouseEnter = this.handleMouseEnter.bind(this); this.handleMouseLeave = this.handleMouseLeave.bind(this); this.createTileList(); this.bindTitle(); // event on app install top.BX.addCustomEvent( top, 'Rest:AppLayout:ApplicationInstall', BX.delegate(this.appInstall, this) ); }; BX.Landing.Component.Demo.prototype = { createTileList : function () { new BX.Landing.TileGrid({ wrapper: this.wrapper, inner: this.inner, tiles: this.tiles, sizeSettings : { minWidth : 250, maxWidth: 281 } }); }, handleMouseEnter: function(tile) { this.showTitle(tile); }, handleMouseLeave: function(tile) { this.hideTitle(tile); }, bindTitle : function () { this.tiles.forEach(function(tile) { var openBtn = tile.querySelector('.landing-item-desc-open'); if(openBtn) { BX.bind(openBtn, 'click', function (event) { event.preventDefault(); this.handleMouseEnter(tile); }.bind(this)); BX.bind(tile, 'mouseleave', function (event) { this.handleMouseLeave(tile) }.bind(this)); } }, this); }, showTitle : function(tile) { this.innerBlock = tile.querySelector('.landing-item-desc-inner'); var descHeightBlock = tile.querySelector('.landing-item-desc-height'); tile.classList.add('landing-tile-title-show'); this.startHeight = BX.style(this.innerBlock, 'height'); this.innerBlock.style.height = descHeightBlock.offsetHeight + 'px'; this.isShow = true; }, hideTitle : function(tile) { if(this.isShow) { this.innerBlock.style.height = this.startHeight; setTimeout(function () { tile.classList.remove('landing-tile-title-show'); this.innerBlock.style.paddingTop = 0; this.innerBlock.style.marginBottom = 0; }.bind(this), 230); this.isShow = false; } }, appInstall: function(installed) { window.location.reload(); } }; })(); BX.ready(function() { var wrapper = BX('grid-tile-wrap'); // load not in landing.demo context if(!wrapper) { return; } var items = [].slice.call(document.querySelectorAll('.landing-template-pseudo-link')); items.forEach(function(item) { if (!BX.hasClass(item, 'landing-item-payment')) { BX.bind(item, 'click', function(event) { if(event.target.classList.contains('landing-item-desc-open') || event.target.classList.contains('landing-item-designed')) { return; } var sliderHref = event.currentTarget.dataset.href; BX.SidePanel.Instance.open(sliderHref, { allowChangeHistory: false, width: BX.data(item, 'slider-width') ? parseInt(BX.data(item, 'slider-width')) : null, data: { rightBoundary: 0 }, events: { onClose: function(eventClosed) { var openerSliderPath = sliderHref.split('?')[0]; var currentSliderPath = eventClosed.slider.iframeSrc.split('?')[0]; if (openerSliderPath !== currentSliderPath && sliderHref.indexOf('frameMode=Y') < 0) { top.location.reload(); } } } }); }); } }); var tiles = Array.prototype.slice.call(wrapper.getElementsByClassName('landing-item')); new BX.Landing.Component.Demo({ wrapper: wrapper, inner: BX('grid-tile-inner'), tiles: tiles }); });