Sha256: e5208506542917312a65f4adc4e503ff7f125f862f7ce40409031e185a459cd3

Contents?: true

Size: 468 Bytes

Versions: 3

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

3 entries across 3 versions & 1 rubygems

Version Path
mercury-rails-0.2.3 vendor/assets/javascripts/mercury/modals/insertsnippet.js.coffee
mercury-rails-0.2.0 vendor/assets/javascripts/mercury/modals/insertsnippet.js.coffee
mercury-rails-0.1.2 app/assets/javascripts/mercury/modals/insertsnippet.js.coffee