Fixed losing focus when dialog open and close. (Tested on Chrome, FF)
Fixed #410. Create a new link when there is no anchor on range.