From 95ad25973e25f847405c1df19a8bc7c3ad6b2712 Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 12 Oct 2017 11:41:53 +0200 Subject: [PATCH] Ability to delete a stronger pad from readonly mode --- www/common/cryptpad-common.js | 4 ++-- www/common/sframe-common-interface.js | 3 --- www/common/sframe-common-outer.js | 6 ++++++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index a6f830354..4962bd072 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -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"); diff --git a/www/common/sframe-common-interface.js b/www/common/sframe-common-interface.js index 6e6b4539d..52d95b040 100644 --- a/www/common/sframe-common-interface.js +++ b/www/common/sframe-common-interface.js @@ -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)) diff --git a/www/common/sframe-common-outer.js b/www/common/sframe-common-outer.js index d06ffd4b5..46534fe9d 100644 --- a/www/common/sframe-common-outer.js +++ b/www/common/sframe-common-outer.js @@ -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); });