Update js to support dialog.