Answer the question
In order to leave comments, you need to log in
How do toaster notifications work?
https://toster.ru/my/tracker
By clicking on the link with a comment / answer, the notification is marked as read, and by clicking on the circle (checkbox), the notification is marked as read / unread.
How does it work? By clicking on the link / checkbox, a request is sent to the database and the value of the notification changes to "read"? If yes, how to do it?
Answer the question
In order to leave comments, you need to log in
something like this
$(document).on("click", ".event__checkbox", function () {
(function (cb) {
cb.prop("checked") ? cb.closest("@event_item").addClass("events-list__item_checked") : cb.closest("@event_item").removeClass("events-list__item_checked");
cb.prop("checked") ? cb.closest("@event_checker").attr({title: "Пометить как прочитанное"}) : cb.closest("@event_checker").attr({title: "Пометить как непрочитанное"});
$.post("tracker/feed_mark_seen_event", {
event_id: cb.data("event_id"),
state: cb.prop("checked") ? 1 : 0
}, "json").fail(fail_func)
})($(this))
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question