Move item-type element confirm dialog to JS file.