From: Alexander Ebert Date: Mon, 18 May 2015 13:00:34 +0000 (+0200) Subject: Cleanup X-Git-Tag: 3.0.0_Beta_1~2394 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5b66af144e07c654c371fdc53f65c7a6c7ffe536;p=GitHub%2FWoltLab%2FWCF.git Cleanup --- diff --git a/com.woltlab.wcf/templates/headIncludeJavaScript.tpl b/com.woltlab.wcf/templates/headIncludeJavaScript.tpl index 53afea9e25..2112a9c3ff 100644 --- a/com.woltlab.wcf/templates/headIncludeJavaScript.tpl +++ b/com.woltlab.wcf/templates/headIncludeJavaScript.tpl @@ -147,30 +147,6 @@ BootstrapFrontend.setup({ styleChanger: {if $__wcf->getStyleHandler()->countStyles() > 1}true{else}false{/if} }); - - require(['WoltLab/WCF/Controller/Popover'], function(ControllerPopover) { - ControllerPopover.init({ - attributeName: 'data-user-id', - className: 'userLink', - identifier: 'com.woltlab.wcf.user', - loadCallback: function(objectId, popover) { - new WCF.Action.Proxy({ - autoSend: true, - data: { - actionName: 'getUserProfile', - className: 'wcf\\data\\user\\UserProfileAction', - objectIDs: [ objectId ] - }, - success: (function(data) { - popover.setContent('com.woltlab.wcf.user', objectId, data.returnValues.template); - }).bind(this), - failure: (function(data) { - // TODO - }).bind(this) - }); - } - }); - }); }); diff --git a/wcfsetup/install/files/js/WoltLab/WCF/BootstrapFrontend.js b/wcfsetup/install/files/js/WoltLab/WCF/BootstrapFrontend.js index 024ea6dd74..11762f26db 100644 --- a/wcfsetup/install/files/js/WoltLab/WCF/BootstrapFrontend.js +++ b/wcfsetup/install/files/js/WoltLab/WCF/BootstrapFrontend.js @@ -6,7 +6,7 @@ * @license GNU Lesser General Public License * @module WoltLab/WCF/BootstrapFrontend */ -define(['WoltLab/WCF/Bootstrap', 'WoltLab/WCF/Controller/Sitemap', 'WoltLab/WCF/Controller/Style/Changer'], function(Bootstrap, ControllerSitemap, ControllerStyleChanger) { +define(['WoltLab/WCF/Bootstrap', 'WoltLab/WCF/Controller/Sitemap', 'WoltLab/WCF/Controller/Style/Changer', 'WoltLab/WCF/Controller/Popover'], function(Bootstrap, ControllerSitemap, ControllerStyleChanger, ControllerPopover) { "use strict"; /** @@ -27,6 +27,35 @@ define(['WoltLab/WCF/Bootstrap', 'WoltLab/WCF/Controller/Sitemap', 'WoltLab/WCF/ if (options.styleChanger) { ControllerStyleChanger.setup(); } + + this._initUserPopover(); + }, + + /** + * Initializes user profile popover. + */ + _initUserPopover: function() { + ControllerPopover.init({ + attributeName: 'data-user-id', + className: 'userLink', + identifier: 'com.woltlab.wcf.user', + loadCallback: function(objectId, popover) { + new WCF.Action.Proxy({ + autoSend: true, + data: { + actionName: 'getUserProfile', + className: 'wcf\\data\\user\\UserProfileAction', + objectIDs: [ objectId ] + }, + success: (function(data) { + popover.setContent('com.woltlab.wcf.user', objectId, data.returnValues.template); + }).bind(this), + failure: (function(data) { + popover.setContent('com.woltlab.wcf.user', objectId, data.returnValues.template); + }).bind(this) + }); + } + }); } };