document arguments

This commit is contained in:
Matthias 2021-11-30 17:22:31 +01:00
parent a1e0bef70d
commit 5d7a153d87
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -143,6 +143,12 @@ function notificationCheck() {
/**
* handles read / unread buttons and UI rebuilding
*
* arguments:
* - btn: element that got clicked / fired the event -> must contain pk and target as attributes
*
* options:
* - panel_caller: this button was clicked in the notification panel
**/
function updateNotificationReadState(btn, panel_caller=false) {
var url = `/api/notifications/${btn.attr('pk')}/${btn.attr('target')}/`;
@ -175,6 +181,10 @@ function updateNotificationReadState(btn, panel_caller=false) {
/**
* Returns the html for a read / unread button
*
* arguments:
* - pk: primary key of the notification
* - state: current state of the notification (read / unread) -> just pass what you were handed by the api
**/
function getReadEditButton(pk, state) {
if (state) {