 
   # Hides details of the timelet.
   #
-  close: ->
+  collapse: ->
+    return unless @model.expanded
     delete @model.expanded
     @ui.label.removeAttr 'contentEditable'
     @ui.label.removeClass 'editing'


  # Shows or hides details of the timelet.
  #
  open: ->
    return if @model.expanded
    else
      @model.collection.trigger 'close'
      @model.expanded = true
      @ui.details.slideDown()
      @ui.label.attr 'contentEditable', 'true'

  events:
    'click .delete'  : 'delete'
    'click .load'    : 'load'
    'click .name'    : 'expand'
    'click .close'   : 'collapse'
    'click .save'    : 'save'
    'blur .editable' : 'updateValue'

  initialize: ->
    @listenTo @model, 'change:loaded', @render
    @listenTo @model.collection, 'collapse', @collapse
    @listenTo @model, 'invalid', @markValidationErrors

  # Updates the model attribute with the corresponding field value.
