update the viewport js.