golden hour
/home/godaofbq/hardchambers.com/wp-content/plugins/essential-addons-elementor/src/js/view
⬆️ Go Up
Upload
File/Folder
Size
Actions
.htaccess
127 B
Del
OK
adv-google-map.js
17.84 KB
Del
OK
advanced-menu.js
11.31 KB
Del
OK
advanced-search.js
14.73 KB
Del
OK
ajax-post-search.js
1.14 KB
Del
OK
content-timeline.js
7.93 KB
Del
OK
counter.js
789 B
Del
OK
data-table.js
510 B
Del
OK
dynamic-filter-gallery.js
1.56 KB
Del
OK
fancy-chart.js
1.02 KB
Del
OK
flip-carousel.js
1.58 KB
Del
OK
image-hotspots.js
3.03 KB
Del
OK
image-scroller.js
1.08 KB
Del
OK
img-comparison.js
2 KB
Del
OK
instagram-gallery.js
4.21 KB
Del
OK
interactive-cards.js
1.42 KB
Del
OK
learn-dash-course-list.js
3.03 KB
Del
OK
lightbox.js
6.26 KB
Del
OK
login-register.js
23.57 KB
Del
OK
logo-carousel.js
7.83 KB
Del
OK
mailchimp.js
2.59 KB
Del
OK
multicolumn-pricing-table.js
1.62 KB
Del
OK
offcanvas.js
376 B
Del
OK
one-page-navigation.js
4.67 KB
Del
OK
post-carousel.js
7 KB
Del
OK
post-list.js
6.54 KB
Del
OK
progress-bar.js
468 B
Del
OK
section-parallax.js
8.5 KB
Del
OK
section-particles.js
4.75 KB
Del
OK
smooth-animation.js
23.66 KB
Del
OK
sphere-photo-viewer.js
967 B
Del
OK
stacked-cards.js
9.16 KB
Del
OK
team-member-carousel.js
5.7 KB
Del
OK
testimonial-slider.js
7.41 KB
Del
OK
toggle.js
3.18 KB
Del
OK
twitter-feed-carousel.js
7.66 KB
Del
OK
woo-account-dashboard.js
2.21 KB
Del
OK
woo-checkout-pro.js
17.02 KB
Del
OK
woo-cross-sells.js
1.9 KB
Del
OK
woo-product-slider.js
5.99 KB
Del
OK
Edit: post-list.js
var postListHandler = function ($scope, $) { // category eael.getToken(); let $post_cat_wrap = $('.post-categories', $scope), $scroll_on_pagination = parseInt( $post_cat_wrap.data('scroll-on-pagination') ), $scroll_on_pagination_offset = parseInt( $post_cat_wrap.data('scroll-offset') ); $post_cat_wrap.on('click', 'a', function (e) { e.preventDefault(); let $this = $(this); // tab class $('.post-categories a', $scope).removeClass('active'); $this.addClass('active'); // collect props const $class = $post_cat_wrap.data('class'), $widget_id = $post_cat_wrap.data("widget"), $page_id = $post_cat_wrap.data("page-id"), $nonce = $post_cat_wrap.data("nonce"), $args = $post_cat_wrap.data('args'), $settings = $post_cat_wrap.data('settings'), $page = 1, $template_info = $post_cat_wrap.data('template'), $taxonomy = { taxonomy: $('.post-categories a.active', $scope).data('taxonomy'), field: 'term_id', terms: $('.post-categories a.active', $scope).data('id') }; // ajax $.ajax({ url: localize.ajaxurl, type: 'POST', data: { action: 'load_more', class: $class, args: $args, taxonomy: $taxonomy, settings: $settings, template_info: $template_info, page: $page, page_id: $page_id, widget_id: $widget_id, nonce: localize.nonce }, success: function (response) { var $content = $(response); if ($content.hasClass('no-posts-found') || $content.length == 0) { $('.eael-post-appender', $scope).empty().append($content); // update nav $('.btn-prev-post', $scope).prop('disabled', true); $('.btn-next-post', $scope).prop('disabled', true); } else { $('.eael-post-appender', $scope) .empty() .append($content); // update page $('.post-list-pagination', $scope).data('page', 1); // update nav $('.btn-prev-post', $scope).prop('disabled', true); $('.btn-next-post', $scope).prop('disabled', false); } }, error: function (response) { console.log(response); } }); }); // load more let $pagination_wrap = $('.post-list-pagination', $scope); $pagination_wrap.on('click', 'button', function (e) { e.preventDefault(); e.stopPropagation(); e.stopImmediatePropagation(); // collect props var $this = $(this), $widget_id = $pagination_wrap.data("widget"), $page_id = $pagination_wrap.data("page-id"), $nonce = $pagination_wrap.data("nonce"), $class = $pagination_wrap.data('class'), $args = $pagination_wrap.data('args'), $settings = $pagination_wrap.data('settings'), $page = $this.hasClass('btn-prev-post') ? parseInt($pagination_wrap.data('page')) - 1 : parseInt($pagination_wrap.data('page')) + 1, $template_info = $pagination_wrap.data('template'), $taxonomy = { taxonomy: $('.post-categories a.active', $scope).data('taxonomy'), field: 'term_id', terms: $('.post-categories a.active', $scope).data('id') }; if (($taxonomy.taxonomy === '') || ($taxonomy.taxonomy === 'all') || ($taxonomy.taxonomy === 'undefined')) { $taxonomy.taxonomy = 'all'; } if ($page == 1 && $this.hasClass("btn-prev-post")) { $this.prop('disabled', true); } $this.prop('disabled', true); if ($page <= 0) { return; } $.ajax({ url: localize.ajaxurl, type: 'post', data: { action: 'load_more', class: $class, args: $args, taxonomy: $taxonomy, settings: $settings, page: $page, template_info: $template_info, page_id: $page_id, widget_id: $widget_id, nonce: localize.nonce }, success: function (response) { var $content = $(response); if ($content.hasClass('no-posts-found') || $content.length == 0) { // do nothing } else { $('.eael-post-appender', $scope) .empty() .append($content); if ($page == 1 && $this.hasClass("btn-prev-post")) { $this.prop('disabled', true); } else { $('.post-list-pagination button', $scope).prop('disabled', false); } $pagination_wrap.data('page', $page); } if ( $scroll_on_pagination && $('.eael-post-appender', $scope).length > 0) { let $post_list_container = $('.eael-post-list-container', $scope); if ( ! isElementInViewport( $post_list_container ) ) { $('html, body').animate({ scrollTop: $post_list_container.offset().top - $scroll_on_pagination_offset }, 500); } } }, error: function (response) { console.log(response); } }); }); function isElementInViewport (el) { if (typeof jQuery === "function" && el instanceof jQuery) { el = el[0]; } var rect = el.getBoundingClientRect(); return ( rect.top >= 0 && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && /* or $(window).height() */ rect.right <= (window.innerWidth || document.documentElement.clientWidth) /* or $(window).width() */ ); } }; jQuery(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction('frontend/element_ready/eael-post-list.default', postListHandler); });
Save