File "metabox.min.js"
Full Path: /home/siazco/grocery.siazco.se/wp-content/plugins/yith-woocommerce-compare/plugin-fw/assets/js/metabox.min.js
File size: 1.89 KB
MIME-type: text/plain
Charset: utf-8
!function(e){var t=e("#_active_page_options-container"),a=t.parent().html();function i(t,a,i,s){var n=!0;if("string"==typeof a){":radio"===a.substr(0,6)&&(a+=":checked");var d=e(a),o=d.attr("type"),r=d.val();switch(o){case"checkbox":r=d.is(":checked")?"yes":"no";break;case"radio":r=d.find('input[type="radio"]').filter(":checked").val()}i=i.split(",");for(var c=0;c<i.length;c++){if(r==i[c]){n=!0;break}n=!1}}var p,h=e(t),b=e(t+"-container").parent(),l=s.split("-");for(p in l){var g=l[p];if(n)switch(g){case"disable":b.removeClass("yith-disabled"),h.attr("disabled",!1);break;case"hide":case"hideNow":b.show();break;case"hideme":h.show();break;case"fadeOut":b.show();break;case"fadeInOut":case"fadeIn":default:b.show(500)}else switch(g){case"disable":b.addClass("yith-disabled"),h.attr("disabled",!0);break;case"hide":case"hideNow":b.hide();break;case"hideme":h.hide();break;case"fadeInOut":case"fadeOut":b.hide(500);break;case"fadeIn":default:b.hide()}}}t.parent().remove(),e(a).insertAfter("#yit-post-setting .handlediv"),e(a).insertAfter("#yit-page-setting .handlediv"),t.on("click",function(){e("#_active_page_options").is(":checked")?e("#yit-page-setting .inside .metaboxes-tab, #yit-post-setting .inside .metaboxes-tab").css({opacity:1,"pointer-events":"auto"}):e("#yit-page-setting .inside .metaboxes-tab, #yit-post-setting .inside .metaboxes-tab").css({opacity:.5,"pointer-events":"none"})}).trigger("click"),e(document.body).on("yith-plugin-fw-metabox-init-deps",function(){e(document.body).trigger("yith-plugin-fw-init-radio"),e(".metaboxes-tab [data-dep-target]:not(.yith-plugin-fw-metabox-deps-initialized)").each(function(){var t=e(this),a="#"+t.data("dep-target"),s="#"+t.data("dep-id"),n=t.data("dep-value"),d=t.data("dep-type");i(a,s,n.toString(),d),e(s).on("change",function(){i(a,s,n.toString(),d)}).change(),t.addClass("yith-plugin-fw-metabox-deps-initialized")})}).trigger("yith-plugin-fw-metabox-init-deps")}(jQuery);