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)
- });
- }
- });
- });
});
</script>
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @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";
/**
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)
+ });
+ }
+ });
}
};