provide new item flashing

This commit is contained in:
Tim Krehan 2019-05-23 08:47:48 +02:00
parent 8c444e1bb9
commit 87e896cbe6

View file

@ -9,9 +9,24 @@ $(document).ready(function () {
function highlightNewEntry(){ function highlightNewEntry(){
var cookies = document.cookie; var cookies = document.cookie;
var cookieRegExp = new RegExp(/newItem(\d+)/ig); var cookieRegExp = new RegExp(/;?\s+newItem=(\d+)/g);
console.log(cookies.match(cookieRegExp)); var match = cookieRegExp.exec(cookies);
if(match!=null){
var newID = match[1];
var checkBox = $("[data-id=" + newID + "]");
var newRow = checkBox.parent().parent();
newRow.removeClass($(checkBox).data("color"));
newRow.addClass("alert-primary");
setTimeout(function () {
newRow.css({
transition: ".5s"
});
newRow.removeClass("alert-primary");
newRow.addClass($(checkBox).data("color"));
}, 1000);
document.cookie = "newItem=-1"
console.log(document.cookie);
}
} }
function deleteCheckeditems() { function deleteCheckeditems() {