SP-997:
- Changed logic in tab close function to fix bug and accommodate for any
  element in the tab content passed to the function