catalog.js 864 B

1234567891011121314151617181920212223242526272829
  1. function addItem(obj)
  2. {
  3. var $inputRow = $(obj).closest('.row-module');
  4. var $newRow = $('#insertItemBox').children('.row-module').clone().insertAfter($inputRow).addClass('highlight');
  5. $newRow.find("input[type!='hidden']").val('');
  6. setTimeout(function()
  7. {
  8. $newRow.removeClass('highlight');
  9. }, 1600);
  10. }
  11. function insertItem(obj)
  12. {
  13. var $inputgroup = $(obj).closest('.row-table');
  14. var insertHtml = $('#insertItemBox').children('.row-table').clone();
  15. $inputgroup.after(insertHtml).next('.row-table').find('input').val('');
  16. }
  17. function deleteItem(obj)
  18. {
  19. var $inputRow = $(obj).closest('.row-module');
  20. if ($inputRow.siblings('.row-module.row-module-new').find('.btn-delete').length > 0)
  21. {
  22. $inputRow.addClass('highlight').fadeOut(500, function()
  23. {
  24. $inputRow.remove();
  25. });
  26. }
  27. }