script.js in Copy Anything to Clipboard for WordPress – Copy Button, Copy Text & Copy Code 3.8.2, at classes/elementor/widgets/deal/script.js
| 1 | (function ($) { |
| 2 | const CTCDeal = { |
| 3 | |
| 4 | /** |
| 5 | * Init |
| 6 | */ |
| 7 | init: function () { |
| 8 | this._bind(); |
| 9 | }, |
| 10 | |
| 11 | /** |
| 12 | * Binds events |
| 13 | */ |
| 14 | _bind: function () { |
| 15 | $( document ).on( 'click', '.ctc-deal-toggle-link', this.toggleDetails ); |
| 16 | }, |
| 17 | |
| 18 | /** |
| 19 | * Toggle Details |
| 20 | */ |
| 21 | toggleDetails: function (event) { |
| 22 | event.preventDefault(); |
| 23 | |
| 24 | const self = $( this ) |
| 25 | const deal = self.parents( '.ctc-deal' ) |
| 26 | const details = deal.find( '.ctc-toggle-details' ) |
| 27 | |
| 28 | details.slideToggle( 'fast' ) |
| 29 | |
| 30 | } |
| 31 | }; |
| 32 | |
| 33 | /** |
| 34 | * Initialization |
| 35 | */ |
| 36 | $(function () { |
| 37 | CTCDeal.init(); |
| 38 | }); |
| 39 | |
| 40 | })(jQuery); |