Ability to delete a stronger pad from readonly mode

pull/1/head
yflory 2017-10-12 11:41:53 +02:00
parent b28c1537e8
commit 95ad25973e
3 changed files with 8 additions and 5 deletions

View File

@ -1204,8 +1204,8 @@ define([
};
// Forget button
var moveToTrash = common.moveToTrash = function (cb) {
var href = window.location.href;
var moveToTrash = common.moveToTrash = function (cb, href) {
href = href || window.location.href;
common.forgetPad(href, function (err) {
if (err) {
console.log("unable to forget pad");

View File

@ -150,9 +150,6 @@ define([
'class': "fa fa-trash cryptpad-forget",
style: 'font:'+size+' FontAwesome'
});
if (!common.isStrongestStored()) {
button.addClass('cp-toolbar-hidden');
}
if (callback) {
button
.click(common.prepareFeedback(type))

View File

@ -216,6 +216,12 @@ define([
});
sframeChan.on('Q_MOVE_TO_TRASH', function (data, cb) {
cb = cb || $.noop;
if (readOnly && hashes.editHash) {
var appPath = window.location.pathname;
Cryptpad.moveToTrash(cb, appPath + '#' + hashes.editHash);
return;
}
Cryptpad.moveToTrash(cb);
});