Skip to content

Commit

Permalink
Don't prevent submit event of element save button
Browse files Browse the repository at this point in the history
The onClickElement handler must not prevent the default browser event, if the event target is a submit button.
  • Loading branch information
tvdeyen committed Jan 22, 2018
1 parent bc1054a commit d639170
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,13 @@ Alchemy.ElementEditors =
# - Triggers custom 'SelectPreviewElement.Alchemy' event on target element in preview frame.
#
onClickElement: (e) ->
$element = $(e.target).closest(".element-editor")
$target = $(e.target)
$element = $target.closest(".element-editor")
element_id = $element.attr("id").replace(/\D/g, "")
@selectElement($element)
@selectElementInPreview(element_id)
e.preventDefault()
# Element submit button needs to keep it's default event
e.preventDefault() unless $target.is(':submit')
return

# Double click event handler for element head.
Expand Down

0 comments on commit d639170

Please sign in to comment.