| 1 |
/*! |
| 2 |
* Filter Everything common admin 1.2.3 |
| 3 |
*/ |
| 4 |
(function($) { |
| 5 |
"use strict"; |
| 6 |
$(document).ready(function (){ |
| 7 |
// Common JS code |
| 8 |
$(document).on('click', '#show_bottom_widget', function (e){ |
| 9 |
if( $(this).is(':checked') ){ |
| 10 |
$('#show_open_close_button').parent('label').addClass('wpc-inactive-settings-field'); |
| 11 |
}else{ |
| 12 |
$('#show_open_close_button').parent('label').removeClass('wpc-inactive-settings-field'); |
| 13 |
} |
| 14 |
}); |
| 15 |
|
| 16 |
$('#wpc_primary_color').wpColorPicker({ |
| 17 |
defaultColor: '', |
| 18 |
palettes: [ '#0570e2', '#f44336', '#E91E63', '#007cba', '#65BC7B', '#FFEB3B', '#FFC107', '#FF9800', '#607D8B'], |
| 19 |
}); |
| 20 |
|
| 21 |
$('.wpc-help-tip').tipTip({ |
| 22 |
'attribute': 'data-tip', |
| 23 |
'fadeIn': 50, |
| 24 |
'fadeOut': 50, |
| 25 |
'delay': 200, |
| 26 |
'keepAlive': true, |
| 27 |
'maxWidth': "220px", |
| 28 |
}); |
| 29 |
|
| 30 |
$( '.wpc-sortable-table' ).sortable({ |
| 31 |
items: "tr.pro-version.wpc-sortable-row", |
| 32 |
delay: 150, |
| 33 |
placeholder: "wpc-filter-field-shadow", |
| 34 |
refreshPositions: true, |
| 35 |
cursor: 'move', |
| 36 |
handle: ".wpc-order-sortable-handle-icon", |
| 37 |
axis: 'y', |
| 38 |
update: function( event, ui ) { |
| 39 |
renderTableOrder(); |
| 40 |
}, |
| 41 |
|
| 42 |
}); |
| 43 |
|
| 44 |
$(document).on( 'click', '.free-version .wpc-field-sortable-handle', function (){ |
| 45 |
alert( wpcFiltersAdminCommon.prefixesOrderAvailableInPro ); |
| 46 |
}); |
| 47 |
|
| 48 |
}); // End $(document).ready(); |
| 49 |
|
| 50 |
|
| 51 |
function renderTableOrder() |
| 52 |
{ |
| 53 |
let num = 0; |
| 54 |
$("tr.wpc-sortable-row").each( function ( index, element ) { |
| 55 |
num = (index + 1); |
| 56 |
$(element).find('.wpc-order-td').text(num); |
| 57 |
}); |
| 58 |
} |
| 59 |
|
| 60 |
})(jQuery); |