Bazując na Twoim kodzie tak bym pozmieniał (sprawdź czy o to Ci chodziło):
var button = document.getElementById('button');
var input = document.getElementById('text');
field();
input.addEventListener('keyup', field);
function field(){
if (!input.value.length){
button.disabled = true;
button.style.backgroundColor = "#ba2525";
}
else{
button.disabled = false;
button.style.backgroundColor = "#3548a0";
}
}