app/assets/javascripts/mercury/region.js.coffee in mercury-rails-0.8.0 vs app/assets/javascripts/mercury/region.js.coffee in mercury-rails-0.9.0
- old
+ new
@@ -26,11 +26,11 @@
Mercury.on 'focus:frame', =>
return if @previewing || Mercury.region != @
@focus()
Mercury.on 'action', (event, options) =>
- return if @previewing || Mercury.region != @
+ return if @previewing || Mercury.region != @ || event.isDefaultPrevented()
@execCommand(options.action, options) if options.action
@element.on 'mousemove', (event) =>
return if @previewing || Mercury.region != @
snippet = jQuery(event.target).closest('[data-snippet]')
@@ -74,11 +74,11 @@
execCommand: (action, options = {}) ->
@focus()
@pushHistory() unless action == 'redo'
Mercury.log('execCommand', action, options.value)
- Mercury.changes = true unless options.already_handled
+ Mercury.changes = true
pushHistory: ->
@history.push(@content())
@@ -92,10 +92,10 @@
return snippets
dataAttributes: ->
data = {}
- data[attr] = @element.attr('data-' + attr) for attr in Mercury.config.regions.dataAttributes
+ data[attr] = (@container || @element).attr('data-' + attr) for attr in Mercury.config.regions.dataAttributes
return data
serialize: ->
return {