mirror of
https://github.com/tim-krehan/shopping-list.git
synced 2024-11-27 15:40:00 +01:00
fixed new item showing up not highlighted
This commit is contained in:
parent
73fbcf6d85
commit
6c0a0f0406
1 changed files with 1 additions and 2 deletions
|
@ -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");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue