From: Alexander Ebert Date: Wed, 4 Jan 2017 12:24:57 +0000 (+0100) Subject: Fixed profile editing behavior X-Git-Tag: 3.0.0~58 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=754a724e43db840223b9e6ca94afbc3b73eb51ba;p=GitHub%2FWoltLab%2FWCF.git Fixed profile editing behavior --- diff --git a/com.woltlab.wcf/templates/pageHeaderUser.tpl b/com.woltlab.wcf/templates/pageHeaderUser.tpl index de4f28b748..c42909b551 100644 --- a/com.woltlab.wcf/templates/pageHeaderUser.tpl +++ b/com.woltlab.wcf/templates/pageHeaderUser.tpl @@ -41,7 +41,7 @@ diff --git a/com.woltlab.wcf/templates/user.tpl b/com.woltlab.wcf/templates/user.tpl index 887efa3c75..06896a6af1 100644 --- a/com.woltlab.wcf/templates/user.tpl +++ b/com.woltlab.wcf/templates/user.tpl @@ -63,7 +63,15 @@ 'wcf.user.editProfile': '{lang}wcf.user.editProfile{/lang}' }); - new WCF.User.Profile.Editor({@$user->userID}, {if $editOnInit}true{else}false{/if}); + var userProfileEditor = new WCF.User.Profile.Editor({@$user->userID}, {if $editOnInit}true{else}false{/if}); + var editLink = elBySel('.interactiveDropdownItemsUserMenu .jsUserPanelEditProfile'); + if (editLink) { + editLink.addEventListener(WCF_CLICK_EVENT, function (event) { + userProfileEditor._beginEdit(event); + + WCF.CloseOverlayHandler.forceExecution(); + }); + } {/if} {if $followingCount > 7} diff --git a/wcfsetup/install/files/js/WCF.User.js b/wcfsetup/install/files/js/WCF.User.js index 05e35bd61d..0bf2e8e742 100644 --- a/wcfsetup/install/files/js/WCF.User.js +++ b/wcfsetup/install/files/js/WCF.User.js @@ -897,6 +897,8 @@ WCF.User.Profile.Editor = Class.extend({ */ _actionName: '', + _active: false, + /** * list of interface buttons * @var object @@ -935,6 +937,7 @@ WCF.User.Profile.Editor = Class.extend({ */ init: function(userID, editOnInit) { this._actionName = ''; + this._active = false; this._cachedTemplate = ''; this._tab = $('#about'); this._userID = userID; @@ -968,6 +971,9 @@ WCF.User.Profile.Editor = Class.extend({ _beginEdit: function(event) { if (event) event.preventDefault(); + if (this._active) return; + this._active = true; + this._actionName = 'beginEdit'; this._buttons.beginEdit.parent().addClass('active'); $('#profileContent').wcfTabs('select', 'about'); @@ -1045,6 +1051,7 @@ WCF.User.Profile.Editor = Class.extend({ */ _restore: function() { this._actionName = 'restore'; + this._active = false; this._buttons.beginEdit.parent().removeClass('active'); this._destroyEditor();