setup tabindex for elements in share dialog
restructure dialog codes