浏览代码

HUE-1581 [jobsub] Saving a design clones it

Abraham Elmahrek 12 年之前
父节点
当前提交
4ef020a
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      apps/jobsub/src/jobsub/templates/designs.mako

+ 3 - 0
apps/jobsub/src/jobsub/templates/designs.mako

@@ -762,6 +762,7 @@ var designTable = $('#designTable').dataTable( designTableOptions );
 /**
  * Redraw a table after the table has been dynamically updated.
  * This is necessary because KO and datatables don't play well together.
+ * This is useful when datatables doesn't automatically update and no extra rows have been added.
  */
 function redraw() {
   designTable.fnDestroy();
@@ -773,9 +774,11 @@ function redraw() {
  * Reload with datatables.
  * Remove datatables, reload, then reinitialize datatables.
  * Knockout doesn't work without this.
+ * Clearing the table is necessary so multiple rows will not be added.
  */
 function reload() {
   $(document).one('load.designs', function() {
+    designTable.fnClearTable();
     designTable.fnDestroy();
   });
   designs.load();