app/assets/javascripts/spina/admin/pages.js.coffee in spina-0.6.29 vs app/assets/javascripts/spina/admin/pages.js.coffee in spina-0.7.0
- old
+ new
@@ -5,11 +5,11 @@
$('.sortable-grid').sortable().bind 'sortupdate', (e) ->
position_array = []
$(e.target).find('li.image').each (index) ->
position_array.push $(this).data('photo-id')
- $(e.target).parents('td').find('.photo-positions').val(position_array.join(","))
+ $(e.target).parents('.horizontal-form-content').find('.photo-positions').val(position_array.join(","))
$('.structure-form-menu ul').sortable().bind 'sortupdate', (e) ->
$(e.target).find('li').each (index) ->
id = $(this).data('structure-item-id')
$(".structure_form_pane_#{id}_position").val(index)
@@ -20,13 +20,13 @@
$(document).on 'change', '.page-template select', ->
page_parts = $(this).find('option:selected').data('page-parts').split(" ")
show_page_parts(page_parts)
show_page_parts = (page_parts) ->
- $('tr.page-part').hide()
+ $('.horizontal-form-group.page-part').hide()
for page_part in page_parts
- $('tr.page-part[data-name=' + page_part + ']').show()
+ $('.horizontal-form-group.page-part[data-name=' + page_part + ']').show()
# Dynamically add and remove fields in a nested form
$(document).on 'click', 'form .add_fields', (event) ->
time = new Date().getTime()
regexp = new RegExp($(this).data('id'), 'g')
@@ -41,10 +41,10 @@
# Dynamically add and remove structures
$(document).on 'click', 'form .add_structure', (event) ->
$structureForm = $(this).parents('.structure-form')
time = new Date().getTime()
- regexp = new RegExp($(this).data('id'), 'g')
+ regexp = new RegExp("#{$(this).data('id')}|new_association", 'g')
$fields = $($(this).data('fields').replace(regexp, time))
$structureForm.find('.structure-form-content').append($fields)
$link = $("<li><a href='#structure_form_pane_#{time}'><i class='icon icon-bars'></i> </a></li>")