From 2f2ab4392cde3889f72be3d57f41782e51a6ea07 Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 20 Jul 2016 12:23:41 +0200 Subject: [PATCH] clear the table on user clicks --- www/poll/wizard.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/www/poll/wizard.js b/www/poll/wizard.js index 69103a0aa..9bd23cd1a 100644 --- a/www/poll/wizard.js +++ b/www/poll/wizard.js @@ -25,7 +25,10 @@ define([ var table = W.table = Table($table, xy); W.cleanup = function () { - // TODO reset table to fresh state + $table.find('tbody tr').remove(); + $table.find('thead th').remove(); + //table.rows.forEach(table.removeRow); + //table.cols.forEach(table.removeColumn); }; W.show = function () { @@ -139,6 +142,9 @@ define([ var $toolbar = $('#modal-toolbar'); var $getOptions = W.$getOptions = $('#get-options'); + var $clearTable = W.$clearTable = ($('#clear-table').click(function () { + W.cleanup(); + })); return W; });