Added onresize to fix firefox+codemirror bug