Select Git revision
startpage.js
Forked from
Stud.IP / Stud.IP
Source project has a limited visibility.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
startpage.js 1.02 KiB
STUDIP.domReady(() => {
if ($('html').is(':not(.responsive-display)')) {
STUDIP.startpage.init();
}
});
// Add handler for "read all" on news widget
$(document).on('click', '#start-index .visit-all', function(event) {
var icon = $(this),
url = icon.attr('href'),
widget = icon.closest('.studip-widget');
icon.prop('disabled', true).addClass('ajaxing');
$.getJSON(url).then(function(response) {
if (response) {
$('article.new', widget).removeClass('new');
$('.news-comments-unread', widget)
.removeClass('news-comments-unread')
.removeAttr('title');
// It is approriate to use attr() to modify data here since
// the attribute's value is displayed via css, thus it needs
// to be actually in the DOM.
$('#nav_start [data-badge]')
.attr('data-badge', 0)
.trigger('badgechange');
icon.remove();
}
});
event.preventDefault();
});