From 7712a8c139a4861f95085a9c2b632526a12559a2 Mon Sep 17 00:00:00 2001 From: ashubawork Date: Thu, 30 Mar 2023 15:45:34 +0300 Subject: [PATCH] - disable all inputs --- assets/js/um-blocks.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/assets/js/um-blocks.js b/assets/js/um-blocks.js index e69de29b..f6da25c9 100644 --- a/assets/js/um-blocks.js +++ b/assets/js/um-blocks.js @@ -0,0 +1,25 @@ +jQuery(window).on( 'load', function($) { + var observer = new MutationObserver(function(mutations) { + mutations.forEach(function(mutation) { + jQuery(mutation.addedNodes).find('.um.um-directory').each(function() { + jQuery('.um-directory input, .um-directory select, .um-directory button').attr('disabled', 'disabled'); + jQuery('.um-directory a').attr('href', ''); + }); + jQuery(mutation.addedNodes).find('.um.um-profile').each(function() { + jQuery('.um-profile input, .um-profile select, .um-profile button').attr('disabled', 'disabled'); + jQuery('.um-profile a').attr('href', ''); + }); + jQuery(mutation.addedNodes).find('.um.um-account').each(function() { + jQuery('.um-account input, .um-account select, .um-account button').attr('disabled', 'disabled'); + jQuery('.um-account a').attr('href', ''); + }); + jQuery(mutation.addedNodes).find('.um.um-password').each(function() { + jQuery('.um-password input, .um-password select, .um-password button').attr('disabled', 'disabled'); + jQuery('.um-password a').attr('href', ''); + }); + }); + }); + + observer.observe(document, {attributes: false, childList: true, characterData: false, subtree:true}); + +});