Sha256: 112916a77f8712b438725359203b97a1d36608df7caa8076e48c73475cc18928

Contents?: true

Size: 697 Bytes

Versions: 3

Compression:

Stored size: 697 Bytes

Contents

$(document).ready ->
  $('form').on 'click', '.remove_fields', (event) ->
    $(this).siblings('input[type=hidden]').val('1')
    $(this).closest('.item').hide()
    return false

  $('form').on 'click', '.add_fields', (event) ->
    time = new Date().getTime()
    regexp = new RegExp('section_id', 'g')
    section = $('#placeholder-section').html()
    $('.sections').append(section.replace(regexp, time))
    $('.section-data-more').unbind 'click'
    $('.section-data-more').bind 'click', (e)->
      $(e.target).siblings('.section-additional-data').toggle()
    return false

  $('.section-data-more').bind 'click', (e)->
    $(e.target).siblings('.section-additional-data').toggle()

  
  

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dust-cms-0.0.07 app/assets/javascripts/cms/dust/sections.js.coffee
dust-cms-0.0.06 app/assets/javascripts/cms/dust/sections.js.coffee
dust-cms-0.0.05 app/assets/javascripts/cms/dust/sections.js.coffee