diff --git a/static/categorize.js b/static/categorize.js index 151c930..6c4ca34 100644 --- a/static/categorize.js +++ b/static/categorize.js @@ -22,14 +22,12 @@ function categorize(theid, successFunction) { insertCategories(); } - $("#button-" + theid).hide(); + $("#button-" + theid).addClass("dontshow"); $.ajax({ type: "POST", url: "/categorize", data: JSON.stringify({itemId: theid, thecategory: theValue}), success: function(data) { - $("#button-" + theid).hide(); - $("#item-" + theid).attr("origValue", theValue); onItemCategorized(theid); }, contentType: "application/json; charset=utf-8" @@ -42,13 +40,6 @@ function isConfirmed(event, theid) { return false; } - var theItem = $("#item-" + theid); - var theButton = $("#button-" + theid); - if (theItem.attr("origValue") != theItem.val()) { - theButton.show(); - } else { - theButton.hide(); - } - + $("#button-" + theid).removeClass("dontshow"); return true; } diff --git a/static/style.css b/static/style.css index f743e14..fb6c447 100644 --- a/static/style.css +++ b/static/style.css @@ -44,3 +44,7 @@ tr:nth-child(odd){ tr:hover { background-color: #ddd; } + +.dontshow { + visibility: hidden; +} diff --git a/views/categorize.tpl b/views/categorize.tpl index 475fce3..6f752c2 100644 --- a/views/categorize.tpl +++ b/views/categorize.tpl @@ -28,8 +28,8 @@ {{shorttitle}} {{amountcurrency}} - - + + %end diff --git a/views/index.tpl b/views/index.tpl index 66f4f31..e5a23ec 100644 --- a/views/index.tpl +++ b/views/index.tpl @@ -91,7 +91,8 @@ function doPlot() { // items.push($(this).val()); //}); - $('#duplicates').html("").hide(); + $('#duplicates').html(""); + $("#inout").html("

Lade Daten ...

"); $.ajax({ type: "POST", url: "/getConsolidated", @@ -101,6 +102,7 @@ function doPlot() { data: JSON.stringify({byCategory: "{{byCategory}}", traces: {{! tracesJSON}}}), % end success: function(thedata) { + $("#inout").html(""); plotData = thedata; if (plotData["foundDuplicates"].length != 0) { $("#duplicates").html("

Mögliche Duplikate gefunden:

\n" + plotData["foundDuplicates"].join('
\n')).show(); @@ -113,7 +115,7 @@ function doPlot() { } function showDetails(theX) { - $("#details").html(""); + $("#details").html("

Lade Details ...

"); $.ajax({ type: "POST", url: "/getDetails",