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 @@