From 4d9001a8e512a3f13b6cb56d6aaa893dfe95f554 Mon Sep 17 00:00:00 2001 From: manolobevia Date: Mon, 31 Oct 2011 22:21:39 +0000 Subject: [PATCH] NIHVIVO-3213: Refactored file --- webapp/web/js/account/accountListenerSetup.js | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/webapp/web/js/account/accountListenerSetup.js b/webapp/web/js/account/accountListenerSetup.js index 3356ee5d3..1e7f2c436 100644 --- a/webapp/web/js/account/accountListenerSetup.js +++ b/webapp/web/js/account/accountListenerSetup.js @@ -11,33 +11,33 @@ $(document).ready(function(){ var theSubmitButton = theForm.find(':submit'); theSubmitButton.addClass("disabledSubmit"); + + function disableSubmit() { + theSubmitButton.removeAttr('disabled'); + theSubmitButton.removeClass("disabledSubmit"); + } $('input').each(function() { if ( $(this).attr('type') != 'submit' && $(this).attr('name') != 'querytext') { $(this).change(function() { - theSubmitButton.removeAttr('disabled'); - theSubmitButton.removeClass("disabledSubmit"); + disableSubmit() }); $(this).bind("propertychange", function() { - theSubmitButton.removeAttr('disabled'); - theSubmitButton.removeClass("disabledSubmit"); + disableSubmit(); }); $(this).bind("input", function() { - theSubmitButton.removeAttr('disabled'); - theSubmitButton.removeClass("disabledSubmit"); + disableSubmit() }); } }); $('select').each(function() { $(this).change(function() { - theSubmitButton.removeAttr('disabled'); - theSubmitButton.removeClass("disabledSubmit"); + disableSubmit() }); }); $('.remove-proxy').click(function(){ - theSubmitButton.removeAttr('disabled'); - theSubmitButton.removeClass("disabledSubmit"); + disableSubmit() }) });