         @saveModel description: @description.val().trim()
 
     makeEditable: =>
+        document.title = "#{t 'application title'} - #{@model.get 'title'}"
         @$el.addClass 'editing'
         @options.editable = true
         @galery.options.editable = true
 
     makeNonEditable: =>
+        document.title = "#{t 'application title'} - #{@model.get 'title'}"
         @$el.removeClass 'editing'
         @options.editable = false
         @galery.options.editable = false

        res

    afterRender: ->
        @galery = new Galery
            el: @$ '#photos'
            editable: @options.editable
            collection: @model.photos
            beforeUpload: @beforePhotoUpload

        @title = @$ '#title'
        @description = @$ '#description'

        @galery.album = @model
        @galery.render()

        # Use title of album as window title
        document.title = "#{t 'application title'} - #{@model.get 'title'}"

        if @options.editable
            @makeEditable()
        else
            @title.addClass 'disabled'
            @description.addClass 'disabled'

    beforePhotoUpload: (callback) =>
        callback albumid: @model.id

                event.preventDefault()
                @model.destroy().then ->
                    app.router.navigate 'albums', true
        true

    # Change sharing state of the album.
    changeClearance: (event) =>
