Small GUI improvement
authorMarcel Werk <burntime@woltlab.com>
Thu, 22 May 2014 23:07:39 +0000 (01:07 +0200)
committerMarcel Werk <burntime@woltlab.com>
Thu, 22 May 2014 23:07:39 +0000 (01:07 +0200)
wcfsetup/install/files/js/WCF.User.js
wcfsetup/install/files/lib/data/user/object/watch/UserObjectWatchAction.class.php

index 6cb887ae67dd35b602be6feb605c7dfd9d123b96..56d4da18a0bd750f2479905c1307371820d91a01 100644 (file)
@@ -2492,6 +2492,16 @@ WCF.User.ObjectWatch.Subscribe = Class.extend({
                else if (data.actionName === 'saveSubscription' && this._dialog.is(':visible')) {
                        this._dialog.wcfDialog('close');
                        
+                       // update icon
+                       var $icon = $(this._buttonSelector + '[data-object-id=' + data.returnValues.objectID + '] > .icon');
+                       if (data.returnValues.subscribe) {
+                               $icon.removeClass('icon-bookmark-empty').addClass('icon-bookmark');
+                       }
+                       else {
+                               $icon.removeClass('icon-bookmark').addClass('icon-bookmark-empty');
+                       }
+                       
+                       // show notification
                        if (this._notification === null) {
                                this._notification = new WCF.System.Notification(WCF.Language.get('wcf.global.success.edit'));
                        }
index 42591f91fedb373eda74edfeca46909aba6fe7e1..11979aacd125e71b204a6ecb6cb92053c144dc20 100644 (file)
@@ -110,6 +110,11 @@ class UserObjectWatchAction extends AbstractDatabaseObjectAction {
                        // reset user storage
                        $this->objectType->getProcessor()->resetUserStorage(array(WCF::getUser()->userID));
                }
+               
+               return array(
+                       'objectID' => $this->parameters['objectID'],
+                       'subscribe' => $this->parameters['subscribe']
+               );
        }
        
        /**