   initialize: =>
     @model.on('change:metadata', @render)
     @saveName
+    @$spinner = $('<span class="spinner-in-field-icon"></span>');
 
   render: =>
     @$('.unit-display-name-input').val(@model.get('metadata').display_name)

    metadata = $.extend({}, @model.get('metadata'))
    metadata.display_name = @$('.unit-display-name-input').val()
    $('.unit-location .editing .unit-name').html(metadata.display_name)
    @model.set('metadata', metadata)

    # save the name after a slight delay
    if @timer

    @timer = setTimeout( =>
      @model.save()
      @timer = null
      @$spinner.delay(500).fadeOut(150)
    , 500)

class CMS.Views.UnitEdit.LocationState extends Backbone.View
