     floatedPanel = splitView.panels.first
     filesPane    = panel.getPaneByName 'filesPane'
 
-    floatedPanel._lastSize = 250
-    splitView.unsetFloatingPanel 0
-    filesPane.tabView.showPaneByIndex 0
-    floatedPanel.off 'ReceivedClickElsewhere'
+    splitView.resizePanel 250, 0
     @getView().unsetClass 'sidebar-collapsed'
+    floatedPanel.unsetClass 'floating'
     @isSidebarCollapsed = no
+    # filesPane.tabView.showPaneByIndex 0
+
+    # floatedPanel._lastSize = 250
+    # splitView.unsetFloatingPanel 0
+    # filesPane.tabView.showPaneByIndex 0
+    # floatedPanel.off 'ReceivedClickElsewhere'
+    # @getView().unsetClass 'sidebar-collapsed'
+    # @isSidebarCollapsed = no
 
   toggleSidebar: ->
     if @isSidebarCollapsed then @expandSidebar() else @collapseSidebar()

    {tabView}    = filesPane
    desiredSize  = 250

    splitView.once 'PanelSetToFloating', =>
      floatedPanel._lastSize = desiredSize
      @getView().setClass 'sidebar-collapsed'
      @isSidebarCollapsed = yes
      KD.getSingleton("windowController").notifyWindowResizeListeners()

    splitView.setFloatingPanel 0, 39
    tabView.showPaneByName 'Dummy'

    tabView.on 'PaneDidShow', (pane) ->
      return if pane.options.name is 'Dummy'
      splitView.showPanel 0
      floatedPanel._lastSize = desiredSize

    floatedPanel.on 'ReceivedClickElsewhere', ->
      KD.utils.defer ->
        splitView.setFloatingPanel 0, 39
        tabView.showPaneByName 'Dummy'

  expandSidebar: ->
    panel        = @workspace.getView()


    # We want double click to work
    # if only the sidebar is collapsed. ~Umut
    expand = (event) =>
      KD.utils.stopDOMEvent event  if event?
      @toggleSidebar()  if @isSidebarCollapsed

    filesPane.on 'TabHandleMousedown', expand

    baseSplit = panel.layout.getSplitViewByName 'BaseSplit'
    baseSplit.resizer.on 'dblclick', @bound 'toggleSidebar'
