Commit 4bb533930ef570f02aa74d9252a25d2459a784fb

Authored by Karpikau Andrei
1 parent fe261190

check duplicate

... ... @@ -109,18 +109,31 @@ jQuery(document).ready(function(){
109 109 delete_cell_url = $block.data('delete_cell_url'),
110 110 mas_cell_id = [];
111 111
112   - $row.find('.col').each(function(){
113   - mas_cell_id.push($(this).data('id'));
114   - });
  112 + if($row.hasClass('row-element-row')){
  113 + $row.find('.col').each(function(){
  114 + mas_cell_id.push($(this).data('id'));
  115 + });
115 116
116   - jQuery.ajax({
117   - type: 'POST',
118   - url: delete_cell_url,
119   - data: {structure_ids: mas_cell_id},
120   - success: function (data) {
121   - $row.remove();
122   - }
123   - });
  117 + jQuery.ajax({
  118 + type: 'POST',
  119 + url: delete_cell_url,
  120 + data: {structure_ids: mas_cell_id},
  121 + success: function (data) {
  122 + $row.remove();
  123 + }
  124 + });
  125 + }
  126 + if($row.hasClass('row-element-block')){
  127 +
  128 + jQuery.ajax({
  129 + type: 'POST',
  130 + url: delete_cell_url,
  131 + data: {structure_id: $row.data('id')},
  132 + success: function (data) {
  133 + $row.remove();
  134 + }
  135 + });
  136 + }
124 137 }
125 138 });
126 139
... ...
... ... @@ -113,8 +113,8 @@ module Kanjai
113 113
114 114 @obj.page_content_markers.each do |item|
115 115 new_item = item.dup
116   - item.page_content = @new_obj
117   - item.save(validate: false)
  116 + new_item.page_content = @new_obj
  117 + new_item.save(validate: false)
118 118 end
119 119 new_ids << next_structure_id
120 120 else
... ... @@ -135,8 +135,8 @@ module Kanjai
135 135
136 136 @obj.page_content_markers.each do |item|
137 137 new_item = item.dup
138   - item.page_content = @new_obj
139   - item.save(validate: false)
  138 + new_item.page_content = @new_obj
  139 + new_item.save(validate: false)
140 140 end
141 141
142 142 render json: {status: 'ok', id: next_structure_id}
... ...
1 1 module Kanjai
2   - VERSION = "0.0.171"
  2 + VERSION = "0.0.172"
3 3 end
... ...