NIHVIVO-3213: Refactored file

This commit is contained in:
manolobevia 2011-10-31 22:21:39 +00:00
parent 51cc2feba0
commit 4d9001a8e5

View file

@ -11,33 +11,33 @@ $(document).ready(function(){
var theSubmitButton = theForm.find(':submit'); var theSubmitButton = theForm.find(':submit');
theSubmitButton.addClass("disabledSubmit"); theSubmitButton.addClass("disabledSubmit");
function disableSubmit() {
theSubmitButton.removeAttr('disabled');
theSubmitButton.removeClass("disabledSubmit");
}
$('input').each(function() { $('input').each(function() {
if ( $(this).attr('type') != 'submit' && $(this).attr('name') != 'querytext') { if ( $(this).attr('type') != 'submit' && $(this).attr('name') != 'querytext') {
$(this).change(function() { $(this).change(function() {
theSubmitButton.removeAttr('disabled'); disableSubmit()
theSubmitButton.removeClass("disabledSubmit");
}); });
$(this).bind("propertychange", function() { $(this).bind("propertychange", function() {
theSubmitButton.removeAttr('disabled'); disableSubmit();
theSubmitButton.removeClass("disabledSubmit");
}); });
$(this).bind("input", function() { $(this).bind("input", function() {
theSubmitButton.removeAttr('disabled'); disableSubmit()
theSubmitButton.removeClass("disabledSubmit");
}); });
} }
}); });
$('select').each(function() { $('select').each(function() {
$(this).change(function() { $(this).change(function() {
theSubmitButton.removeAttr('disabled'); disableSubmit()
theSubmitButton.removeClass("disabledSubmit");
}); });
}); });
$('.remove-proxy').click(function(){ $('.remove-proxy').click(function(){
theSubmitButton.removeAttr('disabled'); disableSubmit()
theSubmitButton.removeClass("disabledSubmit");
}) })
}); });