gutenberg
3 years ago
gutenbergComponents
3 years ago
autoupdate_banner.js
3 years ago
banner_main.js
3 years ago
circle-progress.js
3 years ago
datatables.min.js
4 years ago
jquery.multi-select.js
4 years ago
jquery.tagsinput.min.js
4 years ago
referral_program.js
3 years ago
sidebar-plugin.js
3 years ago
speed.js
3 years ago
two_admin.js
1 year ago
two_admin_bar.js
4 years ago
two_bf_countdown.js
3 years ago
two_deactivate_plugin.js
3 years ago
two_elementor_editor.js
2 years ago
two_preview.js
3 years ago
two_update_white_label.js
1 year ago
two_white_label.js
2 years ago
referral_program.js
31 lines
| 1 | jQuery(document).ready(function() { |
| 2 | |
| 3 | jQuery('.two-referral-copy').on('click', function() { |
| 4 | copyText( jQuery(this), '#two-referral-link' ); |
| 5 | }); |
| 6 | jQuery('.two-referral-copy-topbar').on('click', function() { |
| 7 | copyText( jQuery(this), '#two-referral-link-topbar' ); |
| 8 | }); |
| 9 | |
| 10 | }); |
| 11 | |
| 12 | function copyText(el, id){ |
| 13 | if (!jQuery(el).hasClass('copied')) { |
| 14 | setTimeout(function() { |
| 15 | jQuery(el).removeClass('copied'); |
| 16 | jQuery(el).text('Copy'); |
| 17 | }, 1000); |
| 18 | copyToClipboard(jQuery(id)); |
| 19 | jQuery(el).addClass('copied'); |
| 20 | jQuery(el).text('Copied'); |
| 21 | } |
| 22 | return false; |
| 23 | } |
| 24 | |
| 25 | function copyToClipboard(element) { |
| 26 | var $temp = jQuery("<input>"); |
| 27 | jQuery("body").append($temp); |
| 28 | $temp.val(jQuery(element).text()).select(); |
| 29 | document.execCommand("copy"); |
| 30 | $temp.remove(); |
| 31 | } |