From b1e51782fce5209cfb760e84461e51f46e3c849b Mon Sep 17 00:00:00 2001 From: Pranav Kant Date: Thu, 11 May 2017 19:46:42 +0530 Subject: [PATCH] Bin superfluous returnToDir logic This was initially introduced in OC so that we know which directory to go after we close the editor but this seems unnecessary here in NC as richdocuments is just an iframe which is removed from DOM when we close the document. (cherry picked from commit a5f6569591f11905c75b7cf978f76be12368ba42) Signed-off-by: Andras Timar --- js/documents.js | 12 +----------- js/viewer/viewer.js | 2 +- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/js/documents.js b/js/documents.js index d902d182..f4c5c28e 100644 --- a/js/documents.js +++ b/js/documents.js @@ -72,7 +72,6 @@ var documentsMain = { loadErrorHint : '', renderComplete: false, // false till page is rendered with all required data about the document(s) toolbar : '
', - returnToDir : null, // directory where we started from in the 'Files' app UI : { /* Editor wrapper HTML */ @@ -268,12 +267,8 @@ var documentsMain = { documentsMain.UI.notify(t('richdocuments', 'Failed to revert the document to older version')); } - // generate file id with returnToDir information in it, if any - var fileid = e.currentTarget.parentElement.dataset.fileid.replace(/_.*/, '') + - (documentsMain.returnToDir ? '_' + documentsMain.returnToDir : ''); - // load the file again, it should get reverted now - window.location = OC.generateUrl('apps/richdocuments/index#{fileid}', {fileid: fileid}); + window.location = OC.generateUrl('apps/richdocuments/index#{fileid}', {fileid: e.currentTarget.parentElement.dataset.fileid}); window.location.reload(); documentsMain.overlay.documentOverlay('hide'); } @@ -426,11 +421,6 @@ var documentsMain = { // Does anything indicate that we need to autostart a session? fileId = getURLParameter('fileid').replace(/^\W*/, ''); - if (fileId.indexOf('_') >= 0) { - documentsMain.returnToDir = unescape(fileId.replace(/^[^_]*_/, '')); - fileId = fileId.replace(/_.*/, ''); - } - documentsMain.show(fileId); if (fileId) { diff --git a/js/viewer/viewer.js b/js/viewer/viewer.js index d8eff333..0c5d0572 100644 --- a/js/viewer/viewer.js +++ b/js/viewer/viewer.js @@ -77,7 +77,7 @@ var odfViewer = { ); } else { viewer = OC.generateUrl( - 'apps/richdocuments/index?fileId={fileId}_{dir}&requesttoken={requesttoken}', + 'apps/richdocuments/index?fileId={fileId}&requesttoken={requesttoken}', { fileId: fileId, dir: fileDir,