V
V
Vasily Petrov2018-02-04 23:46:31
PHP
Vasily Petrov, 2018-02-04 23:46:31

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

1 answer(s)
N
Nick Sdk, 2018-02-05
@lidacriss

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 question

Ask a Question

731 491 924 answers to any question