added js helper for the widgets.php page when the plugin is loaded
authordanix <danix@danix.xyz>
Mon, 30 Jul 2018 15:24:20 +0000 (17:24 +0200)
committerdanix <danix@danix.xyz>
Mon, 30 Jul 2018 15:24:20 +0000 (17:24 +0200)
js/dnxwporg-utils.js [new file with mode: 0644]

diff --git a/js/dnxwporg-utils.js b/js/dnxwporg-utils.js
new file mode 100644 (file)
index 0000000..339a437
--- /dev/null
@@ -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