From 8e56d58ff728faf79bbeaaeaa1927b3ae93c90aa Mon Sep 17 00:00:00 2001 From: Pranav Kant Date: Thu, 23 Jun 2016 13:25:44 +0530 Subject: [PATCH 1/2] bccu#1882: Return to where user started by removing redundant call Route /close/ doesn't mean anything, and we were making this additional call always before closing the document. This had a side-effect that sometimes /close/ call would be processed after we assign returnToDir to window.location making browser always stuck in richdocuments#index rather than reeturnToDir. This was mainly the problem in firefox with owncloud9 --- js/documents.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/js/documents.js b/js/documents.js index 0139c2c1..d5552207 100644 --- a/js/documents.js +++ b/js/documents.js @@ -591,14 +591,6 @@ var documentsMain = { ); }, - closeDocument: function() { - var url = OC.generateUrl('apps/richdocuments/close/{file_id}', {file_id: documentsMain.fileId}); - $.post( - url, - { basename : documentsMain.baseName } - ); - }, - renameDocument: function(name) { var url = OC.generateUrl('apps/richdocuments/ajax/documents/rename/{file_id}', {file_id: documentsMain.fileId}); $.post( @@ -648,7 +640,6 @@ var documentsMain = { $('footer,nav').show(); documentsMain.UI.hideEditor(); - documentsMain.closeDocument(); $('#ocToolbar').remove(); if (documentsMain.returnToDir) { From 87f7720d12e130bd1c3cd9306ad1b1f4d784f9e6 Mon Sep 17 00:00:00 2001 From: Pranav Kant Date: Thu, 23 Jun 2016 14:48:27 +0530 Subject: [PATCH 2/2] Remove unused method See 2b302fa1af99ccc05c38c9b29f57570e3a52fac2 --- js/documents.js | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/js/documents.js b/js/documents.js index d5552207..743f77d3 100644 --- a/js/documents.js +++ b/js/documents.js @@ -574,23 +574,6 @@ var documentsMain = { documentsMain.UI.showEditor(documentsMain.fileName); }, - saveDocumentBack: function() { - var url = OC.generateUrl('apps/richdocuments/save/{file_id}', {file_id: documentsMain.fileId}); - $.post( - url, - { basename : documentsMain.baseName }, - function(result) { - if (result && result.status === 'error') { - if (result.message){ - documentsMain.IU.notify(result.message); - } - documentsMain.onEditorShutdown(t('richdocuments', 'Failed to save this document. Please check if it can be saved with an external editor. This might also mean it has been unshared or deleted recently.')); - return; - } - } - ); - }, - renameDocument: function(name) { var url = OC.generateUrl('apps/richdocuments/ajax/documents/rename/{file_id}', {file_id: documentsMain.fileId}); $.post(