Improved object watch subscription ui
authorMarcel Werk <burntime@woltlab.com>
Tue, 19 Jul 2016 22:33:45 +0000 (00:33 +0200)
committerMarcel Werk <burntime@woltlab.com>
Tue, 19 Jul 2016 22:33:45 +0000 (00:33 +0200)
wcfsetup/install/files/js/WCF.User.js

index 97dc371dc3099ea6e713c7d715c6d15d7b324ebe..7dc244e6ddedb6f74bbadef518a95f07ef80872e 100644 (file)
@@ -2823,6 +2823,7 @@ WCF.User.ObjectWatch.Subscribe = Class.extend({
                // bind event listeners
                $(this._buttonSelector).each($.proxy(function(index, button) {
                        var $button = $(button);
+                       $button.addClass('pointer');
                        var $objectID = $button.data('objectID');
                        this._buttons[$objectID] = $button.click($.proxy(this._click, this));
                }, this));
@@ -2945,8 +2946,13 @@ WCF.User.ObjectWatch.Subscribe = Class.extend({
                        $button.data('isSubscribed', true);
                }
                else {
-                       $icon.removeClass('fa-bookmark').addClass('fa-bookmark-o');
-                       $button.data('isSubscribed', false);
+                       if ($button.data('removeOnUnsubscribe')) {
+                               $button.parent().remove();
+                       }
+                       else {
+                               $icon.removeClass('fa-bookmark').addClass('fa-bookmark-o');
+                               $button.data('isSubscribed', false);
+                       }
                        
                        if (this._reloadOnUnsubscribe) {
                                window.location.reload();