 
 module.exports = class SidebarController extends kd.Controller
 
+  @FilterType = {
+    Hidden: 'hidden'
+    Visible: 'visible'
+  }
+
   constructor: (options = {}) ->
 
     super options


  loadVisibilityFilters: ->

    fetchVisibility().then (filters) => @setVisibility filters


  setVisibility: (type, id, state) ->

    fetchVisibility()
      .then (filters) =>
        filters[type][id] = state
        return filters

    new Promise (resolve) ->
      appStorageController.storage('Sidebar')
        .fetchValue 'visibility', (filters) =>
          @setVisibilityFilters filters
          resolve filters


  addManaged: (id) ->


    @managed = {}

    # kd.singletons.mainController.ready =>
    @bindNotificationHandlers()
    @setStateFromStorage()
    @loadVisibilityFilters()


  bindNotificationHandlers: ->
