Sha256: 57f49e97e3ea76ce95054a60587cc5f45b2d13ea8bf215d7c8cb6cf27eaef5f7

Contents?: true

Size: 468 Bytes

Versions: 1

Compression:

Stored size: 468 Bytes

Contents

@Mercury.modalHandlers.insertsnippet = ->
  @element.find('form').submit (event) =>
    event.preventDefault()
    serializedForm = @element.find('form').serializeObject()
    if Mercury.snippet
      snippet = Mercury.snippet
      snippet.setOptions(serializedForm)
      Mercury.snippet = null
    else
      snippet = Mercury.Snippet.create(@options.snippetName, serializedForm)
    Mercury.trigger('action', {action: 'insertsnippet', value: snippet})
    @hide()

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mercury-rails-0.1.1 app/assets/javascripts/mercury/modals/insertsnippet.js.coffee