add a 'collapse' option to 'selectElementContents' helper
allow toolbar button states to change when selection is collapsed