PageSourceSearch

https://www.thefashionlaw.com/wp-content/themes/tfl/assets/js/init.js?ver=7.1.1

js thefashionlaw.com collected 2026-09-24 15:27:21 UTC 10,641 bytes, 319 lines download raw bytes

1(function ($) {
2    $(document).ready(function () {
3
4        $('.loading-holder').addClass('finished');
5
6        // Display menu after page load
7        $(function() {
8            setTimeout(function() { 
9                $("#menu").show(); 
10            }, 500)
11        });
12
13        if ($(window).scrollTop() > 50) {
14          $("header").addClass("current");
15        } else {
16          $("header").removeClass("current");
17        }
18
19        if( $('.pdfemb-viewer').length ) {
20          $('body').addClass('single-case-pdf');
21        }
22
23        // Sticky Header
24        $(function () {
25          $(window).on("scroll", function () {
26              if ($(window).scrollTop() > 50) {
27                  $("header").addClass("current");
28              } else {
29                  $("header").removeClass("current");
30              }
31          });
32        });
33
34        // Hide and Show Search Input in Header
35        $('.toggle').click(function() {
36            $('#target').toggle('slow');
37        });
38        $(".close-form").click(function(){
39            $('#target').toggle('slow');
40        });
41
42        // Add class on Toggle click
43        $("#menuToggle input").click(function(){
44            $('#menuToggle').toggleClass("fixed-toggle");
45        });
46
47        // Year and Month Tabs
48        $('.tab').on('click', function(e) {
49            e.preventDefault();
50            $('a.tab').removeClass("active");
51            $(this).addClass("active");
52            var sel = this.getAttribute('data-toggle-target');
53            $('.tab-content').removeClass('active').filter(sel).addClass('active');
54        });
55
56        // FAQ Toggle and Archive category list Toggle
57        $('.showBtn').click(function() {
58            //$('.hideme').hide();  
59            if ($(this).hasClass('active')) {    
60                $(this).removeClass('active');
61                $('.hideme').slideUp();
62            } else {
63                $('.hideme').slideUp();
64                $('.showBtn').removeClass('active');
65                $(this).addClass('active');
66                $(this).next().filter('.hideme').slideDown();
67            }
68        });
69
70        // Remove and add class on H2 tag on Single post tempalte
71        $('.single-post-content h2').removeClass("general");
72        $('.single-post-content h2').addClass("blog-entries");
73
74        // Categories Tabs On Homepage
75        $(function() {
76            $('.cat-tabs a').click(function(e) {
77
78              e.preventDefault();
79
80              var curr = $(this),
81                currUrl = curr.attr('href'),
82                currID = curr.data('id'),
83                currText = curr.text();
84
85              $.ajax({
86                type: 'POST',
87                url: currUrl,
88                data: {
89                },
90                beforeSend: function () {
91                  
92                },
93                error: function () {
94                 
95                },
96                success: function (response) {
97                  var htmlResponse = $(response).find('.tab-pane').html();
98                  
99                  $('.tabs-content .tab-pane').children().remove();
100                  $('.tabs-content .tab-pane').append(htmlResponse);
101                  // $('.tabs-content .tab-pane .custom-pagination').hide();
102
103                  $('.tags-trigger').attr('data-category', currID).attr('data-tag', '');
104                  $('.single-tag input').prop('checked', false);
105
106                  $('.filter-trigger .tags-trigger').attr('data-url', currUrl);
107                },
108                complete: function () {
109                  curr.parents('.cat-tabs').find('li').removeClass('active');
110                  curr.parent().addClass('active');
111
112                  if( $('html').hasClass('mobile') ) {
113                    $('.showBtn .category-article').text(currText);
114                  }
115                },
116
117              });
118
119            });
120
121            $(document).on('click', '.tags-trigger', function(e){
122            
123              e.preventDefault();
124
125              var selectedTags = [];
126
127              $(".single-tag input:checked").each(function() {
128                var currID = $(this).attr('data-tagid');
129                selectedTags.push(currID);
130              });
131
132              $(this).attr("data-tag", selectedTags.join());
133
134              var curr = $(this),
135                currTag = curr.attr('data-tag'),
136                currCat = curr.attr('data-category'),
137                currUrl = curr.attr('data-url'),
138                newURL = currUrl + '?subcat=' + currTag;
139
140                console.log(newURL);
141              $.ajax({
142                type: 'POST',
143                url: newURL,
144                // dataType: "html",
145                data: {
146                  // action : 'category_tags_filter',
147                  // 'currTag' : currTag,
148                  // 'currCat' : currCat,
149                }, 
150                success: function(response){
151                  // console.log(response);
152                  var htmlResponse = $(response).find('.tab-pane').html();
153                  $('.tab-pane').empty();
154                  $('.tab-pane').html(htmlResponse);
155                  // $('.tabs-content .tab-pane .custom-pagination').show();
156
157                }
158              });
159
160            });
161
162            $('.tags-reset').click(function(e) {
163            
164              e.preventDefault();
165
166              $('.cat-tabs li:first a').click();
167              $('#toggleButton').click();
168
169            });
170
171        });
172
173         // Updated Post Slider Homepage
174        $('.updated-slider').slick({
175            dots: false,
176            arrows: true,
177            infinite: true,
178            autoplay: false,
179            autoplaySpeed: 3000,
180            speed: 1200,
181            pauseOnHover: true,
182            slidesToShow: 4,
183            slidesToScroll: 1,
184            responsive: [
185              {
186                breakpoint: 1199,
187                settings: {
188                  slidesToShow: 3,
189                  slidesToScroll: 1,
190                  dots: false,
191                },
192              },
193              {
194                breakpoint: 991,
195                settings: {
196                  slidesToShow: 2,
197                  slidesToScroll: 1,
198                  dots: false,
199                },
200              },
201              {
202                breakpoint: 767,
203                settings: {
204                  slidesToShow: 1,
205                  slidesToScroll: 1,
206                  dots: false,
207                },
208              }
209            ],
210        });
211
212        // Post Tags Toggle Button
213        $('#toggleButton').click(function() {
214            $('#content').toggle();
215            $(this).toggleClass('active');
216            // if ($('#content').is(':visible')) {
217            //   $('#toggleIcon').attr('src', '/wp-content/uploads/2023/06/white-minus.png');
218            // } else {
219            //   $('#toggleIcon').attr('src', '/wp-content/uploads/2023/06/white-plus.png');
220            // }
221        });
222
223        // Add cursor on input field after open toggle form
224        $(".search-icon .toggle").click(function() {
225          $('#search').focus();
226        });
227
228        if ($('ev-engagement[group-name="myAccount"]').length > 0) {
229          $('.default-post-style').addClass('evolok-wrapper');
230        }
231
232        $(document).on('click', '.tabs-content .custom-pagination a', function(e){
233          e.preventDefault();
234         
235          var curr = $(this),
236          currUrl = curr.attr('href');
237
238          $.ajax({
239            type: 'POST',
240            url: currUrl,
241            data: {
242            },
243            beforeSend: function () {
244              
245            },
246            error: function () {
247             
248            },
249            success: function (response) {
250              var htmlResponse = $(response).find('.tab-pane').html();
251              
252              $('.tabs-content .tab-pane').children().remove();
253              $('.tabs-content .tab-pane').append(htmlResponse);
254              // $('.tabs-content .tab-pane .custom-pagination').hide();
255            },
256            complete: function () {
257              $('html, body').animate({
258                scrollTop: $('.tabs-top').offset().top - $('header').outerHeight()
259              }, 500);
260            },
261
262          });
263        });
264
265        if ($('.right-col.post-image .default-image').length > 0) {
266
267          var firstChild = $('.single-post-content .default-post-style').children().first(),
268              classList = firstChild.attr('class') ? firstChild.attr('class').split(/\s+/) : [];
269        
270          var hasMatchingClass = classList.some(function (className) {
271            return className === 'wp-caption' || className === 'wp-block-image' || /^wp-image-\d+$/.test(className);
272          });
273        
274          var updateImageAndCaption = function (imageElement) {
275            var src = imageElement.is('img') ? imageElement.attr('src') : imageElement.find('img').attr('src');
276            var altText = imageElement.is('img') ? imageElement.attr('alt') : imageElement.find('img').attr('alt');
277        
278            console.log(altText);
279            if (altText) {
280              altText = altText.trim(); // Remove 'image:' from the alt text
281              $('.right-col.post-image .image figcaption').text(altText); // Set the alt text to the figcaption
282            }
283        
284            $('.right-col.post-image .default-image').attr('src', src);
285            firstChild.hide();
286          };
287        
288          if (hasMatchingClass) {
289            updateImageAndCaption(firstChild);
290          } else if (firstChild.is('p') && firstChild.find('img').length > 0) {
291            updateImageAndCaption(firstChild.find('img'));
292          }
293        }      
294
295    });
296
297    $('.daily_links .link-post-box a').each(function() {
298        $(this).attr('target', '_blank');
299    })
300
301    $(document).on('click', '.product-footer .btn', function(){
302      console.log('fixx');
303      $('html, body').animate({
304        scrollTop: 0
305      }, 500);
306    })
307
308    if ($('body').hasClass('single-post')) {
309      $('.default-post-style p a').each(function() {
310        var link = $(this).attr('href');
311        // Check if link is not containing the homeURL
312        if (link.indexOf(homeURL) === -1) {
313          $(this).attr('target', '_blank'); // Open in new tab if external
314        }
315      });
316    }
317    
318
319}(jQuery));

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.