Ability to delete a stronger pad from readonly mode

pull/1/head
yflory 7 years ago
parent b28c1537e8
commit 95ad25973e

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

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

@ -216,6 +216,12 @@ define([
}); });
sframeChan.on('Q_MOVE_TO_TRASH', function (data, cb) { 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); Cryptpad.moveToTrash(cb);
}); });

Loading…
Cancel
Save