PluginProbe
Social Share for WooCommerce / trunk
Social Share for WooCommerce vtrunk
1.2.23 trunk 1.0 1.0.1 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.6.1 1.1.6.2 1.1.7 1.2.0 1.2.1 1.2.1.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.15.1 1.2.16 All 41 releases
product-share / admin / js / backend.js

backend.js in Social Share for WooCommerce trunk, at admin/js/backend.js

67 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (function ($) {
2
3 $(document).ready(function(){
4
5 // Toggle for all icons
6
7 $('.more-icons').on('click', function(e){
8
9 var link = $(this);
10
11 e.preventDefault();
12
13 $('.all-icons').slideToggle('slow', function(){
14 if ($(this).is(':visible')) {
15 link.addClass('close');
16 }
17 else {
18 link.removeClass('close');
19 }
20 });
21
22 });
23
24 // Push Social Icons to display on click
25
26 $( "#base-list li input[type='checkbox']" ).on( "click", function(){
27 var icon = $(this).closest("li").attr( "id" );
28
29 if($(this).prop("checked") == true){
30 if( icon === 'envelope' ){
31 $( "#sortable" ).append('<li id="list_item_'+icon+'"><label><input type="hidden" value="'+icon+'" name="product_share_option[buttons]['+icon+']"><span><i class="fa-solid fa-'+icon+'"></i> Email</span></label></li>');
32 }
33 else if( icon === 'pocket' ){
34 $( "#sortable" ).append('<li id="list_item_'+icon+'"><label><input type="hidden" value="'+icon+'" name="product_share_option[buttons]['+icon+']"><span><i class="fa-brands fa-get-'+icon+'"></i> '+icon+'</span></label></li>');
35 }
36 else{
37
38 $( "#sortable" ).append('<li id="list_item_'+icon+'"><label><input type="hidden" value="'+icon+'" name="product_share_option[buttons]['+icon+']"><span><i class="fa-brands fa-'+icon+'"></i> '+icon+'</span></label></li>');
39 }
40 }
41 else if($(this).prop("checked") == false){
42 $( "#sortable li#list_item_"+icon ).remove();
43 }
44 } );
45
46
47 // Sortable table header
48
49 $('.sortable').sortable({
50 items: 'li',
51 cursor: 'move',
52 scrollSensitivity: 100,
53 helper: function( event, ui ) {
54 ui.children().each( function() {
55 $( this ).width( $( this ).width() );
56 });
57 return ui;
58 },
59 });
60
61 // Color Picker
62 $('.color-field').wpColorPicker();
63
64
65 });
66
67 }(jQuery));