   getTabs: ->
     @parentElement?.querySelectorAll('.tab') ? []
 
+  clearPreview: ->
+    @isPreviewTab = false
+    @itemTitle.classList.remove('temp')
+
   updateIconVisibility: ->
     if atom.config.get 'tabs.showIcons'
       @itemTitle.classList.remove('hide-icon')


  updateModifiedStatus: ->
    if @item.isModified?()
      if atom.config.get('tabs.usePreviewTabs')
        @isPreviewTab = false
        @itemTitle.classList.remove('temp')
      @classList.add('modified') unless @isModified
      @isModified = true
    else

    @isPreviewTab = false
    if atom.config.get('tabs.usePreviewTabs') and @item instanceof TextEditor
      @isPreviewTab = true
      @addEventListener 'dblclick', => @clearPreview()

    @classList.add('tab', 'sortable')

