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