PageSourceSearch

https://www.pinglighting.com/modules/wkdisplaydiscount/views/js/wk_display_discount_front.js

js pinglighting.com collected 2026-10-06 18:27:01 UTC 3,877 bytes, 108 lines download raw bytes

1/**
2* NOTICE OF LICENSE
3*
4* All right is reserved,
5* Please go through LICENSE.txt file inside our module
6*
7* DISCLAIMER
8*
9* Do not edit or add to this file if you wish to upgrade this module to newer
10* versions in the future. If you wish to customize this module for your
11* needs please refer to CustomizationPolicy.txt file inside our module for more information.
12*
13* @author Webkul IN
14* @copyright since 2010 Webkul
15* @license LICENSE.txt
16*/
17
18$(document).ready(function () {
19  $(document).on("click", ".disc-btn", function () {
20    if ($(this).attr('data-view') == 'collapse') {
21      if ($(this).find('.wk_arrow_down').css('display') != 'none') {
22        $('.discount-table').hide()
23        $('.wk_arrow_up').hide()
24        $('.wk_arrow_down').show()
25        $(this).find('.wk_arrow_down').hide();
26        $(this).find('.wk_arrow_up').show();
27        $(this).closest('.product-discounts').find(".discount-table").show(200);
28        if (ps_version < '1.7.6') {
29          margin = 200
30          if ($(this).closest('.product-discounts').find(".discount-table").height() < 200) {
31            margin = $(this).closest('.product-discounts').find(".discount-table").height()
32          }
33          $(this).parents('.product-miniature').css('margin-bottom', margin + 'px')
34        }
35      } else {
36        $(this).find('.wk_arrow_down').show();
37        $(this).find('.wk_arrow_up').hide();
38        $(this).closest('.product-discounts').find(".discount-table").hide(200);
39        if (ps_version < '1.7.6') {
40          $('.product-miniature').removeAttr('style');
41        }
42      }
43      $('.wk_arrow_up').parent().blur()
44    } else {
45      if ($(this).next().length) {
46        $(this).next().modal('show')
47        if (ps_version < '1.7.6') {
48          $(this).next().addClass('wk_modal_view_' + $(this).parents('.product-miniature').attr('data-id-product'))
49          $('.wk_modal_view_' + $(this).parents('.product-miniature').attr('data-id-product')).insertAfter($('.modal-backdrop'))
50        }
51      } else {
52        $('.wk_modal_view_' + $(this).parents('.product-miniature').attr('data-id-product')).modal('show')
53      }
54    }
55  });
56  $(document).click(function (e) {
57    if ($('.disc-btn').attr('data-view') == 'collapse') {
58      if ($(e.target).hasClass('wk_arrow_down') || $(e.target).hasClass('wk_arrow_up') || $(e.target).hasClass('disc-btn')) {
59      } else {
60        $('.discount-table').hide()
61        $('.wk_arrow_up').hide()
62        $('.wk_arrow_down').show()
63        if (ps_version < '1.7.6') {
64          $('.product-miniature').removeAttr('style');
65        }
66      }
67    }
68  })
69
70  if (current_controller == 'product') {
71    if (!is_default_pos) {
72      $(".product-discounts:not(.wk-product-discounts)").hide();
73    } else if (config_unit_price == 1) {
74      var i = 0;
75      $(".table-product-discounts").addClass('table-responsive');
76      $(".table-product-discounts").find("tr").each(function () {
77        if (i == 0) {
78          $(this).append("<th>" + txt_unit_price + "</th>");
79        } else {
80          $(this).append("<td>" + allUnitPrice[i - 1] + "</td>");
81        }
82        i++;
83      });
84    }
85    if (wk_hook_position_table) {
86        var scrollHtml = $('.wk-product-discounts').html();
87        $('.wk-product-discounts').empty();
88        scrollHtml = '<section class="product-discounts wk-product-discounts">' + scrollHtml + '</section>';
89        $('.product-container .scroll-box-arrows').after(scrollHtml);
90    }
91
92  }
93
94  $(document).ajaxComplete(function (event, xhr, settings) {
95    if (typeof settings.data !== "undefined") {
96      var ajax_data = settings.data;
97      var refresh_url = ajax_data.match('action=refresh')
98      if (refresh_url) {
99        if (current_controller == 'product') {
100          if (!is_default_pos) {
101            $(".product-discounts:not(.wk-product-discounts)").hide();
102          }
103        }
104      }
105    }
106  });
107
108});

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.