From 38cb3d1da942201ae9efb1318e81be77325e2037 Mon Sep 17 00:00:00 2001 From: danix Date: Mon, 30 Jul 2018 17:24:20 +0200 Subject: [PATCH] added js helper for the widgets.php page when the plugin is loaded --- js/dnxwporg-utils.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 js/dnxwporg-utils.js 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 -- 2.20.1