fixed new item showing up not highlighted

This commit is contained in:
Tim Krehan 2019-05-26 17:09:15 +02:00
parent 73fbcf6d85
commit 6c0a0f0406

View file

@ -13,7 +13,7 @@ function highlightNewEntry(){
var match = cookieRegExp.exec(cookies); var match = cookieRegExp.exec(cookies);
if(match!=null){ if(match!=null){
var newID = match[1]; var newID = match[1];
var checkBox = $("[data-id=" + newID + "]"); var checkBox = $(`[data-id='${newID}']`);
var newRow = checkBox.parent().parent(); var newRow = checkBox.parent().parent();
newRow.removeClass($(checkBox).data("color")); newRow.removeClass($(checkBox).data("color"));
newRow.addClass("alert-primary"); newRow.addClass("alert-primary");
@ -48,7 +48,6 @@ function checkItem() {
}, },
success: function () { success: function () {
var dataIdSelector = (`[data-id='${dataId}']`); var dataIdSelector = (`[data-id='${dataId}']`);
// console.log(dataIdSelector);
var color = $(dataIdSelector).data("color"); var color = $(dataIdSelector).data("color");
$(dataIdSelector).parent().parent().removeClass("bg-danger"); $(dataIdSelector).parent().parent().removeClass("bg-danger");