mirror of
https://github.com/friendica/friendica
synced 2024-11-10 21:42:55 +00:00
8ad523fbc8
- removed/fixed whitespaces and mixture of spaces/tabs (some) - added new-line character at end of files (POSIX-compilant) - reverted some code which I had messed up (compared to upstream/develop) - removed duplicate dba::update() invocation in src/Protocol/DFRN.php - also removed no longer valid TODO Signed-off-by: Roland Häder <roland@mxchange.org>
36 lines
967 B
JavaScript
36 lines
967 B
JavaScript
|
|
/**
|
|
* @brief Javascript for the notifications module
|
|
*/
|
|
|
|
// Catch the intro ID from the URL
|
|
var introID = location.pathname.split("/").pop();
|
|
|
|
$(document).ready(function(){
|
|
// Since only the DIV's inside the notification-list are marked
|
|
// with the class "unseen", we need some js to transfer this class
|
|
// to the parent li list-elements.
|
|
if($(".notif-item").hasClass("unseen")) {
|
|
$(".notif-item.unseen").parent("li").addClass("unseen");
|
|
}
|
|
});
|
|
|
|
$(window).load(function(){
|
|
// Scroll to the intro by its intro ID.
|
|
if (isIntroID()) {
|
|
scrollToItem('intro-' + introID);
|
|
}
|
|
});
|
|
|
|
// Check if it is a real introduction ID.
|
|
function isIntroID() {
|
|
// Check for the correct path.
|
|
if (window.location.href.indexOf("/notifications/intros/") !== -1) {
|
|
// Make sure the introID is a positive Integer value.
|
|
var intVal = Number(introID);
|
|
if (Math.floor(intVal) !== Infinity && String(intVal) === introID && intVal > 0) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|