Work-around for legacy notification messages w/o a link
authorAlexander Ebert <ebert@woltlab.com>
Sun, 14 Dec 2014 13:56:38 +0000 (14:56 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 14 Dec 2014 13:56:38 +0000 (14:56 +0100)
wcfsetup/install/files/js/WCF.User.js

index f598944bcd1553c9ff6368568a3a2a58a707e7c9..9767fb9d6e7ad387478f8b7c520e0bb64b296aec 100644 (file)
@@ -1724,6 +1724,13 @@ WCF.Notification.List = Class.extend({
                                var $markAsConfirmed = $('<a href="#" class="icon icon24 fa-check notificationItemMarkAsConfirmed jsTooltip" title="' + WCF.Language.get('wcf.user.notification.markAsConfirmed') + '" />').appendTo($item);
                                $markAsConfirmed.click($.proxy(this._markAsConfirmed, this));
                        }
+                       
+                       // work-around for legacy notifications
+                       if (!$item.find('a').length) {
+                               $item.find('.details > p:eq(0)').html(function(index, oldHTML) {
+                                       return '<a href="' + $item.data('link') + '">' + oldHTML + '</a>';
+                               });
+                       }
                }).bind(this));
                
                WCF.DOMNodeInsertedHandler.execute();