ECMS-5357: Correct the DOM and fix js problem in Insert Portal Page plugin