From 51c065d13c57072979b5e3f034f49a93f24e0fe1 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 28 Aug 2017 14:18:33 +0200 Subject: [PATCH] Fix link to main in the new toolbar --- www/common/toolbar3.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/www/common/toolbar3.js b/www/common/toolbar3.js index 970dc4c53..a3a6df89b 100644 --- a/www/common/toolbar3.js +++ b/www/common/toolbar3.js @@ -585,7 +585,7 @@ define([ }).appendTo($hoverable).text(config.pageTitle); }; - var createLinkToMain = function (toolbar) { + var createLinkToMain = function (toolbar, config) { var $linkContainer = $('', { 'class': "cryptpad-link" }).appendTo(toolbar.$top); @@ -593,7 +593,9 @@ define([ // We need to override the "a" tag action here because it is inside the iframe! var inDrive = /^\/drive/; - var href = inDrive ? '/index.html' : '/drive/'; + var origin = config.metadataMgr.getPrivateData().origin; + + var href = inDrive ? origin+'/index.html' : origin+'/drive/'; var buttonTitle = inDrive ? Messages.header_homeTitle : Messages.header_logoTitle; var $aTag = $('', { @@ -609,7 +611,7 @@ define([ window.open(href); return; } - window.location = href; + window.top.location = href; }; var onContext = function (e) { e.stopPropagation(); };