 
   focus: ->
 
-
-  collectDataAttributes: ->
-    @data = {}
-    $(Mercury.config.regionDataAttributes).each (index, item) =>
-      @data[item] = @element.attr('data-' + item)
 
   bindEvents: ->
     Mercury.on 'mode', (event, options) => @togglePreview() if options.mode == 'preview'

  togglePreview: ->
    if @previewing
      @previewing = false
      @element.addClass(Mercury.config.regionClass).removeClass("#{Mercury.config.regionClass}-preview")
      @focus() if Mercury.region == @
    else
      @previewing = true
      @element.addClass("#{Mercury.config.regionClass}-preview").removeClass(Mercury.config.regionClass)
      Mercury.trigger('region:blurred', {region: @})



    return snippets


  dataAttributes: ->
    data = {}
    data[attr] = @element.attr('data-' + attr) for attr in Mercury.config.regions.dataAttributes
    return data


  serialize: ->
    return {
      type: @type
      data: @dataAttributes()
      value: @content(null, true)
      snippets: @snippets()
    }
