PageSourceSearch

https://bellaugello.com/wp-content/themes/rehomes/assets/js/theme.js?ver=1.0

js bellaugello.com collected 2026-10-02 23:54:06 UTC 24,223 bytes, 608 lines download raw bytes

1'use strict';
2
3var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
4
5function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
6
7(function ($) {
8    var OpalThemeBacktop = function () {
9        function OpalThemeBacktop() {
10            _classCallCheck(this, OpalThemeBacktop);
11
12            this.initBacktotop();
13        }
14
15        _createClass(OpalThemeBacktop, [{
16            key: 'initBacktotop',
17            value: function initBacktotop() {
18                jQuery(window).scroll(function () {
19                    if (jQuery(this).scrollTop() > 200) {
20                        jQuery('.scrollup').fadeIn().addClass('activate');
21                    } else {
22                        jQuery('.scrollup').fadeOut().removeClass('activate');
23                    }
24                });
25                jQuery('.scrollup').on('click', function () {
26                    jQuery("html, body").animate({ scrollTop: 0 }, 600);
27                    return false;
28                });
29            }
30        }]);
31
32        return OpalThemeBacktop;
33    }();
34
35    new OpalThemeBacktop();
36    jQuery('html').removeClass('no-js').addClass('js yes-js js_active');
37
38    var OpalThemeFooter = function () {
39        function OpalThemeFooter() {
40            _classCallCheck(this, OpalThemeFooter);
41
42            this.init();
43        }
44
45        _createClass(OpalThemeFooter, [{
46            key: 'init',
47            value: function init() {
48                var _this = this;
49
50                if (jQuery('body').hasClass('footer-fixed')) {
51                    this.$footer = jQuery('#colophon');
52                    this.$content = jQuery('#page');
53                    this.$footer.css({
54                        position: 'fixed',
55                        left: 0,
56                        bottom: 0,
57                        zIndex: 0
58                    });
59
60                    this.setup();
61
62                    $(window).resize(function () {
63                        _this.setup();
64                    });
65                }
66            }
67        }, {
68            key: 'setup',
69            value: function setup() {
70                this.$content.css({
71                    marginBottom: this.getFooterHeight()
72                });
73            }
74        }, {
75            key: 'getFooterHeight',
76            value: function getFooterHeight() {
77                return this.$footer.outerHeight();
78            }
79        }]);
80
81        return OpalThemeFooter;
82    }();
83
84    new OpalThemeFooter();
85
86    var OpalTheme_Main_Menu = function () {
87        function OpalTheme_Main_Menu() {
88            _classCallCheck(this, OpalTheme_Main_Menu);
89
90            this.initSubmenuHover();
91        }
92
93        _createClass(OpalTheme_Main_Menu, [{
94            key: 'initSubmenuHover',
95            value: function initSubmenuHover() {
96                var _this2 = this;
97
98                $('.site-header .main-navigation .menu-item-has-children').hover(function (event) {
99                    var $item = $(event.currentTarget);
100                    _this2.setPositionLvN($item);
101                });
102            }
103        }, {
104            key: 'setPositionLvN',
105            value: function setPositionLvN($item) {
106                var sub = $item.children('.sub-menu'),
107                    offset = $item.offset(),
108                    width = $item.outerWidth(),
109                    screen_width = $(window).width(),
110                    sub_width = sub.outerWidth();
111                var align_delta = offset.left + width + sub_width - screen_width;
112                if (align_delta > 0) {
113                    sub.css({ left: 'auto', right: '100%' });
114                } else {
115                    sub.css({ left: '', right: '' });
116                }
117            }
118        }]);
119
120        return OpalTheme_Main_Menu;
121    }();
122
123    new OpalTheme_Main_Menu();
124
125    var OpalThemeOwlCarousel = function OpalThemeOwlCarousel() {
126        _classCallCheck(this, OpalThemeOwlCarousel);
127    };
128
129    new OpalThemeOwlCarousel();
130
131    function opalAddQuantityBoxes() {
132        var $quantitySelector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '.qty';
133
134
135        var $quantityBoxes = void 0;
136
137        $quantityBoxes = jQuery('div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)').find($quantitySelector);
138
139        if ($quantityBoxes && 'date' != $quantityBoxes.prop('type')) {
140
141            // Add plus and minus boxes
142            $quantityBoxes.parent().addClass('buttons_added').prepend('<input type="button" value="-" class="minus" />');
143            $quantityBoxes.addClass('input-text').after('<input type="button" value="+" class="plus" />');
144
145            // Target quantity inputs on product pages
146            jQuery('input' + $quantitySelector + ':not(.product-quantity input' + $quantitySelector + ')').each(function () {
147                var $min = parseFloat(jQuery(this).attr('min'));
148
149                if ($min && $min > 0 && parseFloat(jQuery(this).val()) < $min) {
150                    $(this).val($min);
151                }
152            });
153
154            jQuery('.plus, .minus').unbind('click');
155
156            jQuery('.plus, .minus').on('click', function () {
157
158                // Get values
159                var $quantityBox = $(this).parent().find($quantitySelector),
160                    $currentQuantity = parseFloat($quantityBox.val()),
161                    $maxQuantity = parseFloat($quantityBox.attr('max')),
162                    $minQuantity = parseFloat($quantityBox.attr('min')),
163                    $step = $quantityBox.attr('step');
164
165                // Fallback default values
166                if (!$currentQuantity || '' === $currentQuantity || 'NaN' === $currentQuantity) {
167                    $currentQuantity = 0;
168                }
169                if ('' === $maxQuantity || 'NaN' === $maxQuantity) {
170                    $maxQuantity = '';
171                }
172
173                if ('' === $minQuantity || 'NaN' === $minQuantity) {
174                    $minQuantity = 0;
175                }
176                if ('any' === $step || '' === $step || undefined === $step || '
176NaN' === parseFloat($step)) {
177                    $step = 1;
178                }
179
180                // Change the value
181                if ($(this).is('.plus')) {
182
183                    if ($maxQuantity && ($maxQuantity == $currentQuantity || $currentQuantity > $maxQuantity)) {
184                        $quantityBox.val($maxQuantity);
185                    } else {
186                        $quantityBox.val($currentQuantity + parseFloat($step));
187                    }
188                } else {
189
190                    if ($minQuantity && ($minQuantity == $currentQuantity || $currentQuantity < $minQuantity)) {
191                        $quantityBox.val($minQuantity);
192                    } else if ($currentQuantity > 0) {
193                        $quantityBox.val($currentQuantity - parseFloat($step));
194                    }
195                }
196
197                // Trigger change event
198                $quantityBox.trigger('change');
199            });
200        }
201    }
202    jQuery(document).ready(function ($) {
203        opalAddQuantityBoxes();
204    });
205    jQuery(document).ajaxComplete(function ($) {
206        opalAddQuantityBoxes();
207    });
208
209    var OpalThemeScrollbar = function () {
210        function OpalThemeScrollbar() {
211            _classCallCheck(this, OpalThemeScrollbar);
212
213            this.initScrollbar();
214        }
215
216        _createClass(OpalThemeScrollbar, [{
217            key: 'initScrollbar',
218            value: function initScrollbar() {
219                var body = document.querySelector('body');
220                if (window.innerWidth > body.clientWidth + 5) {
221                    body.classList.add('has-scrollbar');
222                    body.setAttribute('style', '--scroll-bar: ' + (window.innerWidth - body.clientWidth) + 'px');
223                } else {
224                    body.classList.remove('has-scrollbar');
225                }
226            }
227        }]);
228
229        return OpalThemeScrollbar;
230    }();
231
232    new OpalThemeScrollbar();
233
234    var OpalThemeSmoothMenu = function () {
235        function OpalThemeSmoothMenu() {
236            var _this3 = this;
237
238            _classCallCheck(this, OpalThemeSmoothMenu);
239
240            poemeJS.smoothCallback = function (selector) {
241                jQuery('.opal-smooth-menu a[href^="' + selector + '"]').trigger('click');
242            };
243
244            jQuery('body').on('click', '.opal-smooth-menu a[href^="#"]', function (e) {
245                e.preventDefault();
246                _this3.menuActiveClass(e);
247                var target = e.currentTarget.hash;
248                var $target = $(target);
249                if ($target.length > 0) {
250                    jQuery('html, body').animate({
251                        'scrollTop': $target.offset().top - _this3.getOffset()
252                    }, 600, 'swing');
253                }
254            });
255        }
256
257        _createClass(OpalThemeSmoothMenu, [{
258            key: 'menuActiveClass',
259            value: function menuActiveClass(e) {
260                var $this = $(e.currentTarget);
261                jQuery('.opal-smooth-menu').find('li.menu-item').removeClass('current-menu-item current_page_item');
262                var selector = $this.closest('li').attr('id');
263                jQuery('.opal-smooth-menu [id="' + selector + '"]').addClass('current-menu-item');
264            }
265        }, {
266            key: 'getOffset',
267            value: function getOffset() {
268                var offset = 0;
269                var $adminBar = jQuery('#wpadminbar');
270                var $stickyHeader = jQuery('#opal-header-sticky');
271
272                if ($adminBar.length > 0) {
273                    offset += $adminBar.outerHeight();
274                }
275
276                if ($stickyHeader.length > 0) {
277                    offset += $stickyHeader.outerHeight();
278                }
279
280                return offset;
281            }
282        }]);
283
284        return OpalThemeSmoothMenu;
285    }();
286
287    new OpalThemeSmoothMenu();
288
289    var OpalThemeStickyHeader = function () {
290        function OpalThemeStickyHeader() {
291            _classCallCheck(this, OpalThemeStickyHeader);
292
293            this.sticky();
294        }
295
296        _createClass(OpalThemeStickyHeader, [{
297            key: 'sticky',
298            value: function sticky() {
299                var $scope = $('.single-portfolio-menu');
300                if ($scope.length > 0) {
301                    var section_offset = $scope.offset().top,
302                        $wpadminbar = $('#wpadminbar'),
303                        section_top = 0,
304                        section_height = $scope.outerHeight();
305                    if ($wpadminbar.length) {
306                        section_top = $wpadminbar.height();
307                    }
308                    if ($(window).width() < 601) {
309                        section_top = 0;
310                    }
311
312                    $(window).resize(function () {
313                        $scope.removeClass('sticky-show');
314                        $scope.css({
315                            top: 0
316                        });
317                        var $h_animate = $scope.next('.h-animate');
318                        $h_animate.remove();
319                        if (!$scope.hasClass('sticky-show')) {
320                            section_offset = $scope.offset().top;
321                        }
322                        section_top = 0;
323                        if ($wpadminbar.length) {
324                            section_top = $wpadminbar.height();
325                        }
326                        if ($(window).width() < 601) {
327                            section_top = 0;
328                        }
329                    });
330                    $(window).scroll(function () {
331                        if ($(window).width() > 768) {
332                            if ($(window).scrollTop() >= section_offset + section_height - section_top) {
333                                if (!$scope.hasClass('sticky-show')) {
334                                    $scope.addClass('sticky-show');
335                                    $scope.css({
336                                        top: section_top
337                                    });
338                                    $("<div class='h-animate'></div>").insertAfter($scope).css({
339                                        height: section_height
340                                    });
341                                }
342                            } else {
343                                $scope.removeClass('sticky-show');
344                                $scope.css({
345                                    top: 0
346                                });
347                                var $h_animate = $scope.next('.h-animate');
348                                $h_animate.remove();
349                            }
350                        }
351                    });
352                }
353            }
354        }]);
355
356        return OpalThemeStickyHeader;
357    }();
358
359    jQuery(document).ready(function ($) {
360        new OpalThemeStickyHeader();
361    });
362
363    var OpalTheme = function () {
364        function OpalTheme() {
365            var _this4 = this;
366
367            _classCallCheck(this, OpalTheme);
368
369            this.SetUpBreacumb();
370            this.SetUpBlog();
371            jQuery(window).resize(function () {
372                _this4.SetUpBreacumb();
373            });
374            this.PortfolioScroll();
375        }
376
377        _createClass(OpalTheme, [{
378            key: 'SetUpBreacumb',
379            value: function SetUpBreacumb() {
380
381                var header = jQuery('body.opal-header-absolute #masthead .site-header'),
382                    breacumb = jQuery('.page-title-bar .wrap');
383
384                var minHeight = 420;
385                if (header.length) {
386                    var Height = header.height();
387
388                    if (jQuery(window).width() > 992) {
389                        breacumb.css({
390                            'min-height': minHeight + Height,
391                            'padding-top': Height
392                        });
393                    } else {
394                        breacumb.css({
395                            'min-height': '',
396                            'padding-top': ''
397                        });
398                    }
399                }
400            }
401        }, {
402            key: 'SetUpBlog',
403            value: function SetUpBlog() {
404                var morelink = $('body:not(.single) .site-main article .entry-content');
405                var search = $('body:not(.single) .site-main article .post-content-wrap');
406                morelink.each(function () {
407                    var hasmorelink = $(this).find('.more-link-wrap');
408                    var hasmorelink2 = $(this).find('.link-more');
409                    if (hasmorelink || hasmorelink2) {
410                        hasmorelink.parents('.post-content-wrap').addClass('has-readmore_tag');
411                        hasmorelink2.parents('.post-content-wrap').addClass('has-readmore_tag');
412                    }
413                });
414                search.each(function () {
415                    var postfooter = $(this).find('.post-footer');
416                    if (postfooter) {
417                        postfooter.parents('.post-content-wrap').addClass('has-post_footer');
418                    }
419                });
420            }
421        }, {
422            key: 'PortfolioScroll',
423            value: function PortfolioScroll() {
424
425                $('body').on('click', '.single-portfolio-menu a', function (e) {
426                    e.preventDefault();
427                    var href = $(this).attr('href');
428                    if ($(href).length) {
429                        $('html,body').animate({ scrollTop: $(href).offset().top }, 500);
430                    }
431                });
432            }
433        }]);
434
435        return OpalTheme;
436    }();
437
438    jQuery(document).ready(function ($) {
439        new OpalTheme();
440    });
441
442    var OpalThemeToogle = function () {
443        function OpalThemeToogle() {
444            _classCallCheck(this, OpalThemeToogle);
445
446            this.setupHeader();
447            this.toggleCollapse();
448            this.ToggleCanvasFilter();
449            this.PositionAccount();
450            this.toggleCollapseSearchFooter();
451            this.toggleCollapseWoo();
452        }
453
454        _createClass(OpalThemeToogle, [{
455            key: 'setupHeader',
456            value: function setupHeader() {
457                jQuery('#masthead .search-button[data-search-toggle]').each(function (index, element) {
458                    var $button = $(element);
459                    if ($button.hasClass('top-to-bottom') || $button.hasClass('popup')) {
460                        var $searchform = $($button.data('target'));
461                        $searchform.data('height', $searchform.outerHeight()).prependTo('#page').addClass('loaded');
462                    } else if ($button.hasClass('bottom-to-top')) {
463                        var _$searchform = $($button.data('target'));
464                        _$searchform.data('height', _$searchform.outerHeight()).prependTo('#page');
465                    }
466                });
467            }
468        }, {
469            key: 'toggleCollapse',
470            value: function toggleCollapse() {
471                var _this5 = this;
472
473                jQuery('body').on('click', '[data-search-toggle="toggle"]', function (e) {
474                    e.preventDefault();
475                    var $button = $(e.currentTarget);
476                    var $searchForm = $($button.data('target'));
477                    var $buttonClose = $searchForm.find('[data-search-toggle="close"]');
478                    $buttonClose.on('click', function (e) {
479                        $button.removeClass('active');
480                        $searchForm.removeClass('active');
481                        jQuery('body').removeClass('over-hidden');
482                        if ($buttonClose.closest('.bottom-to-top')) {
483                            $searchForm.css('top', '100%');
484                        }
485                    });
486                    if ($button.is('.top-to-bottom, .bottom-to-top, .popup')) {
487                        $searchForm.toggleClass('active');
488                        $button.toggleClass('active');
489                    }
490                    if ($button.hasClass('top-to-bottom')) {
491                        _this5.setupTopToBottom($button, $searchForm);
492                    } else if ($button.hasClass('bottom-to-top')) {
493                        _this5.setupBottomToTop($button, $searchForm);
494                    } else if ($button.hasClass('popup')) {
495                        _this5.setupFullScreen($button, $searchForm);
496                    } else {
497                        $button.toggleClass('active');
498                        $button.siblings($searchForm).toggleClass('active');
499                        $(document.createElement('div')).addClass('dropdown-backdrop').insertAfter($button.siblings($searchForm)).on('click', function () {
500                            jQuery(this).siblings().removeClass("active");
501                            jQuery(this).remove();
502                        });
503                    }
504                });
505            }
506        }, {
507            key: 'toggleCollapseWoo',
508            value: function toggleCollapseWoo() {
509                jQuery('body').on('click', '.woocommerce-message, .woocommerce-info, .woocommerce-error', function () {
510                    $(this).addClass('hidden-notice');
511                });
512                jQuery('.home .woocommerce-message, .home .woocommerce-info, .home .woocommerce-error').detach().insertAfter('.opal-wrapper');
513                jQuery('.track_order').prev('.woocommerce-message, .woocommerce-info, .woocommerce-error').detach().insertAfter('.opal-wrapper');
514            }
515        }, {
516            key: 'toggleCollapseSearchFooter',
517            value: function toggleCollapseSearchFooter() {
518                jQuery('body').on('click', '.search-footer', function (e) {
519                    e.preventDefault();
520                    $('.handheld-footer-bar .search').toggleClass('active');
521                });
522            }
523        }, {
524            key: 'checkScroll',
525            value: function checkScroll($object) {
526                var element = $object.get(0);
527                return element.scrollHeight > $(window).height();
528            }
529        }, {
530            key: 'setupFullScreen',
531            value: function setupFullScreen($button, $searchForm) {
532                var $body = jQuery('body');
533                if (this.checkScroll($body)) {
534                    $body.toggleClass('over-hidden');
535                }
536            }
537        }, {
538            key: 'setupTopToBottom',
539            value: function setupTopToBottom($button, $searchForm) {
540                jQuery('body').animate({ scrollTop: 0 }, 600);
541            }
542        }, {
543            key: 'setupBottomToTop',
544            value: function setupBottomToTop($button, $searchForm) {
545                var $header = jQuery('.site-header'),
546                    $sticky = jQuery('.sticky-show'),
547                    stickyHeight = $sticky.outerHeight(),
548                    adminbarHeight = jQuery('#wpadminbar').height(),
549                    position = $header.height() + adminbarHeight;
550                if (stickyHeight > 1) {
551                    position = stickyHeight + adminbarHeight;
552                }
553                if ($searchForm.hasClass('active')) {
554                    $searchForm.css('top', position);
555                } else {
556                    $searchForm.css('top', '100%');
557                }
558                var $body = $('body');
559                if (this.checkScroll($body)) {
560                    $body.toggleClass('over-hidden');
561                }
562            }
563        }, {
564            key: 'ToggleCanvasFilter',
565            value: function ToggleCanvasFilter() {
566                jQuery('body').on('click', '.opal-overlay-filter , .filter-close', function () {
567                    jQuery('body').removeClass('opal-canvas-filter-open');
568                    jQuery('.filter-toggle').removeClass('active');
569                }).on('click', '.filter-toggle', function (event) {
570                    var $body = jQuery('body');
571                    var filterToggle = $(event.currentTarget);
572                    if ($body.hasClass('opal-canvas-filter-open')) {
573                        filterToggle.removeClass('active');
574                        $body.removeClass('opal-canvas-filter-open');
575                        $body.find('.opal-canvas-filter.top').slideToggle(1000);
576                    } else {
577                        filterToggle.addClass('active');
578                        $body.addClass('opal-canvas-filter-open');
579                        $body.find('.opal-canvas-filter.top').slideToggle(1000);
580                    }
581                });
582            }
583        }, {
584            key: 'PositionAccount',
585            value: function PositionAccount() {
586                jQuery('body').on('hover', '.site-header-account', function () {
587                    var $drop = jQuery(this).find('.account-dropdown');
588                    if ($drop.length > 0) {
589                        var position = $drop.offset().top - $(window).scrollTop() + $drop.outerHeight(true),
590                            top = position - jQuery(window).height();
591                        if (top > 0) {
592                            $drop.css({
593                                'transform': 'translateY( -' + top + 'px)'
594                            });
595                        }
596                    }
597                });
598            }
599        }]);
600
601        return OpalThemeToogle;
602    }();
603
604    jQuery(document).ready(function ($) {
605        new OpalThemeToogle();
606    });
607})(jQuery);
608//# sourceMappingURL=theme.js.map

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.