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/yandex.market/ui/ |
Upload File : |
(function(BX, $, window) { var Plugin = BX.namespace('YandexMarket.Plugin'); var Ui = BX.namespace('YandexMarket.Ui'); var constructor = Ui.Collapse = Plugin.Base.extend({ defaults: { targetElement: null, duration: 200, alt: null, lang: {}, }, initialize: function() { this.bind(); }, destroy: function() { this.unbind(); this.callParent('destroy', constructor); }, bind: function() { this.handleClick(true); }, unbind: function() { this.handleClick(false); }, handleClick: function(dir) { this.$el[dir ? 'on' : 'off']('click', $.proxy(this.onClick, this)); }, onClick: function(evt) { this.toggle(); evt.preventDefault(); }, isActive: function() { return this.$el.hasClass('is--active'); }, activate: function() { this.toggle(true); }, deactivate: function() { this.toggle(false); }, toggle: function(dir) { var dirNormalized = (dir != null ? !!dir : !this.isActive()); this.toggleSelf(dirNormalized); this.toggleTarget(dirNormalized); }, toggleSelf: function(dir) { var alt = this.options.alt; this.$el.toggleClass('is--active', dir); if (alt != null) { this.options.alt = this.$el.text(); this.$el.text(alt); } }, toggleTarget: function(dir) { var target = this.getElement('target'); target[dir ? 'slideDown' : 'slideUp'](this.options.duration, function() { target.toggleClass('is--active', dir); }); }, }, { dataName: 'uiCollapse' }); })(BX, jQuery, window);