From b41e26365f7fd4d9d21d357a2c8768bed97c7ea1 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Fri, 23 May 2014 01:07:39 +0200 Subject: [PATCH] Small GUI improvement --- wcfsetup/install/files/js/WCF.User.js | 10 ++++++++++ .../user/object/watch/UserObjectWatchAction.class.php | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/wcfsetup/install/files/js/WCF.User.js b/wcfsetup/install/files/js/WCF.User.js index 6cb887ae67..56d4da18a0 100644 --- a/wcfsetup/install/files/js/WCF.User.js +++ b/wcfsetup/install/files/js/WCF.User.js @@ -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')); } diff --git a/wcfsetup/install/files/lib/data/user/object/watch/UserObjectWatchAction.class.php b/wcfsetup/install/files/lib/data/user/object/watch/UserObjectWatchAction.class.php index 42591f91fe..11979aacd1 100644 --- a/wcfsetup/install/files/lib/data/user/object/watch/UserObjectWatchAction.class.php +++ b/wcfsetup/install/files/lib/data/user/object/watch/UserObjectWatchAction.class.php @@ -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'] + ); } /** -- 2.20.1