Bug 1017681 - Move button active behaviour into JS. r=benfrancis