From: danix Date: Mon, 30 Jul 2018 15:24:20 +0000 (+0200) Subject: added js helper for the widgets.php page when the plugin is loaded X-Git-Url: https://git.danix.xyz/?p=danixland-wporg-stats.git;a=commitdiff_plain;h=38cb3d1da942201ae9efb1318e81be77325e2037;ds=sidebyside added js helper for the widgets.php page when the plugin is loaded --- diff --git a/js/dnxwporg-utils.js b/js/dnxwporg-utils.js new file mode 100644 index 0000000..339a437 --- /dev/null +++ b/js/dnxwporg-utils.js @@ -0,0 +1,15 @@ +( function( $ ) { + "use strict"; + + $( document ).ready( function() { + $("input#dnxwporg_use_desc").click( function() { + if ( $(this).prop("checked") ) { + $("textarea#dnxwporg_custom_desc").prop("disabled", !$("input#dnxwporg_use_desc").prop("checked")); + $("textarea#dnxwporg_custom_desc").focus(); + } else { + $("textarea#dnxwporg_custom_desc").prop("disabled", $("input#dnxwporg_use_desc").prop("checked")); + } + }); + }); + +})(jQuery); \ No newline at end of file