Display a button to open the editing link while in read-only mode if we know it

This commit is contained in:
yflory
2017-03-03 18:14:53 +01:00
parent 27241488a5
commit 2a1b241592
8 changed files with 139 additions and 76 deletions

View File

@@ -417,6 +417,10 @@ define([
userData: userData,
readOnly: readOnly,
ifrw: ifrw,
share: {
secret: secret,
channel: info.channel
},
title: {
onRename: renameCb,
defaultName: defaultName,
@@ -429,8 +433,6 @@ define([
var $rightside = $bar.find('.' + Toolbar.constants.rightside);
var $userBlock = $bar.find('.' + Toolbar.constants.username);
var $editShare = $bar.find('.' + Toolbar.constants.editShare);
var $viewShare = $bar.find('.' + Toolbar.constants.viewShare);
var $usernameButton = module.$userNameButton = $($bar.find('.' + Toolbar.constants.changeUsername));
var editHash;
@@ -462,17 +464,6 @@ define([
var $forgetPad = Cryptpad.createButton('forget', true, {}, forgetCb);
$rightside.append($forgetPad);
if (!readOnly) {
$editShare.append(Cryptpad.createButton('editshare', false, {editHash: editHash}));
}
if (viewHash) {
/* add a 'links' button */
$viewShare.append(Cryptpad.createButton('viewshare', false, {viewHash: viewHash + '/present'}));
if (!readOnly) {
$viewShare.append(Cryptpad.createButton('viewopen', false, {viewHash: viewHash + '/present'}));
}
}
var $present = Cryptpad.createButton('present', true)
.click(function () {
enterPresentationMode(true);