summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordanix <danix@danix.xyz>2018-07-30 17:24:20 +0200
committerdanix <danix@danix.xyz>2018-07-30 17:24:20 +0200
commit38cb3d1da942201ae9efb1318e81be77325e2037 (patch)
tree764d58b1e2f985735c482f8596600ebe90bc4b54
parent086f160fac8424d8619d0ffd2bc23b1cfc0ab7ae (diff)
downloaddanixland-wporg-stats-38cb3d1da942201ae9efb1318e81be77325e2037.tar.gz
danixland-wporg-stats-38cb3d1da942201ae9efb1318e81be77325e2037.zip
added js helper for the widgets.php page when the plugin is loaded
-rw-r--r--js/dnxwporg-utils.js15
1 files changed, 15 insertions, 0 deletions
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