diff --git a/management/univention-portal/www/main.js b/management/univention-portal/www/main.js index 7c0876a130..e88841e23c 100644 --- a/management/univention-portal/www/main.js +++ b/management/univention-portal/www/main.js @@ -953,12 +953,7 @@ define([ d.iframe.addEventListener('load', lang.hitch(this, function() { var pathname = lang.getObject('contentWindow.location.pathname', false, d.iframe); if (pathname === '/univention/portal/loggedin/') { - login.start(null, null, true).then(lang.hitch(this, function() { - this._setupEditModeIfAuthorized(); - this._refresh(portalTools.RenderMode.NORMAL).then(lang.hitch(this, function() { - this._addLinks(); - })); - })); + login.start(null, null, true); this._selectHome(); this._removeIframe('$__login__$'); } @@ -1452,7 +1447,6 @@ define([ this._initProperties(); this._registerEventHandlerForSearch(); - this._setupEditModeIfAuthorized(); this._renderSidebar(); this._render(portalTools.RenderMode.NORMAL); this._addLinks(); @@ -1463,6 +1457,13 @@ define([ on(window, 'resize', lang.hitch(this, function() { this._handleWindowResize(); })); + + login.onLogin(lang.hitch(this, function() { + this._setupEditModeIfAuthorized(); + this._refresh(portalTools.RenderMode.NORMAL).then(lang.hitch(this, function() { + this._addLinks(); + })); + })); }, _initProperties: function() {