 TabView = require './tab-view'
 
 class TabBarView extends HTMLElement
-  createdCallback: ->
+  initialize: (@pane) ->
     @classList.add("list-inline")
     @classList.add("tab-bar")
     @classList.add("inset-panel")
     @setAttribute("tabindex", -1)
 
-  initialize: (@pane) ->
     @tabs = []
     @tabsByElement = new WeakMap
     @subscriptions = new CompositeDisposable

    (@paneContainer.getPanes().length > 1) or (@pane.getItems().length > 1)

  onDragStart: (event) ->
    return unless matches(event.target, '.sortable')

    event.dataTransfer.setData 'atom-event', 'true'

    @draggedTab = @tabForElement(event.target)
    @draggedTab.element.classList.add('is-dragging')
    @draggedTab.destroyTooltip()


    @removeDropTargetClasses()

    tabBar = event.target.closest('.tab-bar')
    sortableObjects = tabBar.getTabs()
    placeholder = @getPlaceholder()
    return unless placeholder?

