if (getNotificationId(oldNotification) != "new-sone-notification") {
return;
}
- oldIds = getElementIds(oldNotification, ".sone-id");
- newIds = getElementIds(newNotification, ".sone-id");
+ oldIds = getElementIds(oldNotification, ".new-sone-id");
+ newIds = getElementIds(newNotification, ".new-sone-id");
$.each(oldIds, function(index, value) {
if ($.inArray(value, newIds) == -1) {
markSoneAsKnown(getSone(value), true);
});
if (!foundNotification) {
if (notificationId == "new-sone-notification") {
- $(".sone-id", this).each(function(index, element) {
+ $(".new-sone-id", this).each(function(index, element) {
soneId = $(this).text();
markSoneAsKnown(getSone(soneId), true);
});
}
/**
- * Returns the current page of the selected pagination.
+ * Returns the current page of the selected pagination. If no pagination can be
+ * found with the given selector, {@code 1} is returned.
*
* @param paginationSelector
* The pagination selector
* @returns The current page of the pagination
*/
function getPage(paginationSelector) {
- return $(".current-page", paginationSelector).text();
+ pagination = $(paginationSelector);
+ if (pagination.length > 0) {
+ return $(".current-page", paginationSelector).text();
+ }
+ return 1;
}
/**