Effect of monomer structure and ionic comonomer composition on the coil-to-globule transition in hydrogels