           handler.call(this, event)
 
   didToggle: (event) ->
+    @saveSetting("open", @isOpen())
     @render()
 
   isOpen: ->

    {@compositionController, @composition} = @editorController

    @element = document.createElement("details")
    @element.classList.add(@template)

    @titleElement = document.createElement("summary")


  renderTitle: ->
    @titleElement.innerHTML = @getTitle()

  getSetting: (key) ->
    key = @getSettingsKey(key)
    window.sessionStorage?[key]

  saveSetting: (key, value) ->
    key = @getSettingsKey(key)
    window.sessionStorage?[key] = value

  getSettingsKey: (key) ->
    "trix/inspector/#{@template}/#{key}"
