     return snippets
 
 
+  dataAttributes: ->
+    data = {}
+    data[attr] = @element.attr('data-' + attr) for attr in Mercury.config.regions.dataAttributes
+    return data
+
+
   serialize: ->
     return {
       type: @type
-      data: @data
+      data: @dataAttributes()
       value: @content(null, true)
       snippets: @snippets()
     }


  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'

    Mercury.log("building #{@type}", @element, @options)

    @document = @window.document
    @name = @element.attr(Mercury.config.regions.identifier)
    @history = new Mercury.HistoryBuffer()
    @build()
    @bindEvents()
