Showing
2 changed files
with
13 additions
and
1 deletions
| ... | ... | @@ -195,6 +195,14 @@ jQuery(document).ready(function(){ |
| 195 | 195 | return max_id; |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | + var getOriginalElementState = function($obj){ | |
| 199 | + if($obj.hasClass('disabled')){ | |
| 200 | + return 'disabled'; | |
| 201 | + }else{ | |
| 202 | + return 'enabled'; | |
| 203 | + } | |
| 204 | + } | |
| 205 | + | |
| 198 | 206 | $('.html-generator').on('click', '.col-operation .col-duplicate, .row-operation .col-duplicate', function(){ |
| 199 | 207 | var $this = $(this); |
| 200 | 208 | |
| ... | ... | @@ -218,6 +226,7 @@ jQuery(document).ready(function(){ |
| 218 | 226 | if(data.status == 'ok'){ |
| 219 | 227 | var $newRow = $row.clone(false); |
| 220 | 228 | $row.after($newRow); |
| 229 | + $newRow.data('status', getOriginalElementState($newRow)); | |
| 221 | 230 | |
| 222 | 231 | $newRow.find('.col').each(function(index){ |
| 223 | 232 | if(data.ids[index] == ''){ |
| ... | ... | @@ -228,6 +237,7 @@ jQuery(document).ready(function(){ |
| 228 | 237 | $(this).data('id', data.ids[index]); |
| 229 | 238 | $(this).attr('data-id', data.ids[index]); |
| 230 | 239 | } |
| 240 | + $(this).data('status', getOriginalElementState($(this))); | |
| 231 | 241 | }); |
| 232 | 242 | |
| 233 | 243 | $block.find('.save').trigger('click'); |
| ... | ... | @@ -261,6 +271,8 @@ jQuery(document).ready(function(){ |
| 261 | 271 | $newCell.attr('data-id', data.id); |
| 262 | 272 | } |
| 263 | 273 | $cell.after($newCell); |
| 274 | + | |
| 275 | + $newCell.data('status', getOriginalElementState($newCell)); | |
| 264 | 276 | $block.find('.save').trigger('click'); |
| 265 | 277 | } |
| 266 | 278 | } | ... | ... |