duplicated from saved-search-edit.js