PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.5.1
Yatra – Travel Booking & Tour Operator Software v3.0.5.1
3.0.15 3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 2.0.10 All 83 releases
yatra / assets / js / trip-category-shortcode.js

trip-category-shortcode.js in Yatra – Travel Booking & Tour Operator Software 3.0.5.1, at assets/js/trip-category-shortcode.js

50 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 jQuery(document).ready(function($) {
2 'use strict';
3
4 $(document).on('click', '.yatra-trip-category-shortcode .yatra-destination-pagination a', function(e) {
5 e.preventDefault();
6
7 var $link = $(this);
8 var $container = $link.closest('.yatra-trip-category-shortcode');
9 var page = $link.data('page');
10 var atts = $container.data('atts');
11
12 if (!page || !atts || typeof yatraTripCategoryShortcode === 'undefined') {
13 return;
14 }
15
16 $container.addClass('yatra-loading');
17
18 $.post(yatraTripCategoryShortcode.ajaxurl, {
19 action: 'yatra_trip_category_shortcode_load',
20 nonce: yatraTripCategoryShortcode.nonce,
21 page: page,
22 atts: atts
23 }, function(response) {
24 if (response.success) {
25 var $innerContent = $('<div>').html(response.data.html);
26 var $newRoot = $innerContent.find('.yatra-trip-category-shortcode');
27
28 if ($newRoot.length) {
29 var newInnerContent = $newRoot.html();
30 var newAtts = $newRoot.data('atts');
31 $container.html(newInnerContent);
32 if (newAtts) {
33 $container.data('atts', newAtts);
34 }
35 } else {
36 $container.html(response.data.html);
37 }
38
39 $('html, body').animate({
40 scrollTop: $container.offset().top - 100
41 }, 300);
42
43 $(document).trigger('yatraTripCategoryShortcodeUpdated', [response.data]);
44 }
45 }).always(function() {
46 $container.removeClass('yatra-loading');
47 });
48 });
49 });
50