Moved span resizing to resize function