Fix link to main in the new toolbar

pull/1/head
yflory 7 years ago
parent d9bf2abcd8
commit 51c065d13c

@ -585,7 +585,7 @@ define([
}).appendTo($hoverable).text(config.pageTitle); }).appendTo($hoverable).text(config.pageTitle);
}; };
var createLinkToMain = function (toolbar) { var createLinkToMain = function (toolbar, config) {
var $linkContainer = $('<span>', { var $linkContainer = $('<span>', {
'class': "cryptpad-link" 'class': "cryptpad-link"
}).appendTo(toolbar.$top); }).appendTo(toolbar.$top);
@ -593,7 +593,9 @@ define([
// We need to override the "a" tag action here because it is inside the iframe! // We need to override the "a" tag action here because it is inside the iframe!
var inDrive = /^\/drive/; 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 buttonTitle = inDrive ? Messages.header_homeTitle : Messages.header_logoTitle;
var $aTag = $('<a>', { var $aTag = $('<a>', {
@ -609,7 +611,7 @@ define([
window.open(href); window.open(href);
return; return;
} }
window.location = href; window.top.location = href;
}; };
var onContext = function (e) { e.stopPropagation(); }; var onContext = function (e) { e.stopPropagation(); };

Loading…
Cancel
Save