PageSourceSearch

https://geiss.ru/bitrix/templates/furniture_pink/js/script.js?16069145994547

js geiss.ru collected 2026-10-08 15:04:37 UTC 4,547 bytes, 161 lines download raw bytes

1/*
2* @Author: aflade
3* @Date:   2016-06-28 15:47:02
4* @Last Modified by:   aflade
5* @Last Modified time: 2016-09-08 15:14:41
6*/
7
8'use strict';
9
10
11jQuery(function($){
12    var fancyboxOps = {
13        padding: 0,
14        autoWidth: true,
15        tpl: {
16            closeBtn: '<a title="Close" class="close-btn" href="javascript:;"></a>'
17        },
18        helpers: {
19            overlay: {
20                locked: false
21            }
22        },
23        afterClose: function(e) {
24            var $form = $(this.href);
25            console.log($form);
26            if ($form.length) {
27                $form.remove();
28            }
29        }
30    };
31    $('.modal-form').on('click', function(e){
32        e.preventDefault();
33
34        var $this = $(this),
35            target = $this.attr('href');
36
37        loadWebForm($(target));
38    });
39
40
41
42    function loadWebForm($this) {
43        var data = $.extend({}, $this.data(), {ajax: 'y'}),
44            url = data.url;
45        delete data.url;
46
47        $.get(url, data, function(r){
48            $this.html(r);
49
50            setTimeout(function(){
51                $('.js-webform').webform();
52
53                var selector = '#'+$this.find('.modal').attr('id');
54                var options = $.extend({
55                    'href': selector,
56                },fancyboxOps);
57                // $.fancybox(data);
58                console.log(options);
59                $.fancybox(options);
60
61                // $(selector).on('close', function(){
62                //     console.log('close');
63                // });
64            }, 50);
65        });
66    };
67
68    var container_selector = '.js-container';
69    var content_selector = '.js-content';
70    var nav_selector = '.js-nav';
71    $(container_selector).on('click', '.js-nav a', function(e){
72        e.preventDefault();
73
74        var $this = $(this),
75            url = $this.attr('href'),
76            $parent = $this.closest(container_selector);
77
78        $.get(url, {ajax: 'Y'}, function(res){
79            var $res = $(res);
80            var $container = $res.filter(container_selector);
81            if (!$container.length) {
82                $container = $res.find(container_selector);
83            }
84            if ($container.length) {
85                $parent.find(content_selector).append(
86                    $container.find(content_selector).children()
87                )
88                $parent.find(nav_selector).replaceWith(
89                    $container.find(nav_selector).children()
90                );
91            }
92        });
93    });
94
95    $('.js-filter-city').on('change', function(){
96        var $this = $(this),
97            val = $this.val();
98
99        $.get('', {ajax: 'Y', city: val}, function(res){
100            var $res = $(res);
101            var $content = $res.filter(content_selector);
102            if (!$content.length) {
103                $content = $res.find(content_selector);
104            }
105            $(content_selector).html(
106                $content.html()
107            );
108        });
109    });
110
111    $('.js-filter-year').on('change', function(){
112        var $this = $(this),
113            val = $this.val(),
114            url = $this.find(':selected').data('href');
115
116        $.get(url, {ajax: 'Y'}, function(res){
117            var $res = $(res);
118            var $content = $res.filter(content_selector);
119            if (!$content.length) {
120                $content = $res.find(content_selector);
121            }
122            $(content_selector).html(
123                $content.html()
124            );
125        });
126    });
127
128    $('.accordion__name').on('click', function(){
129        var $accordion = $(this).closest('.accordion');
130        setTimeout(function(){
131            if ($accordion.is('.open')) {
132                $accordion.find('.collapsed-text').each(function(){
133                    var $this = $(this),
134                        height1  = $this.height(),
135                        height2 = $this.find('.product-option__desc').height();
136
137                    if ((height1-height2) > 90) {
138                        $this.removeClass('collapsed-text');
139                    }
140                });
141            }
142        }, 50);
143    });
144
145    $('.video_play').on('click', function(){
146      var video = document.getElementById("popup_video__video");
147
148      $('.popup_video_fon').fadeIn();
149      $('.popup_video').fadeIn();
150      video.play();
151    });
152
153    $('.popup_video_fon').on('click', function(){
154      var video = document.getElementById("popup_video__video");
155      video.pause();
156      $('.popup_video').fadeOut();
157      $('.popup_video_fon').fadeOut();
158
159
160    });
161});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.