Add method to get the current notification hash.
[Sone.git] / src / main / resources / static / javascript / sone.js
index b819333..abf3fbd 100644 (file)
@@ -1088,6 +1088,14 @@ function ajaxifyNotification(notification) {
 }
 
 /**
+ * Returns the notification hash. This hash is used in {@link #getStatus()} to
+ * determine whether the notifications changed and need to be reloaded.
+ */
+public getNotificationHash() {
+       return $("#sone #notification-area #notification-hash").text();
+}
+
+/**
  * Retrieves element IDs from notification elements.
  *
  * @param notification
@@ -1347,7 +1355,7 @@ function isViewSonePage() {
  * @returns The ID of the currently shown Sone
  */
 function getShownSoneId() {
-       return $("#sone .sone-id").text();
+       return $("#sone .sone-id").first().text();
 }
 
 /**