diff options
author | Jan Holesovsky <kendy@collabora.com> | 2018-04-20 18:19:26 +0300 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-04-20 18:19:26 +0300 |
commit | 1b57dd435fcd7f0904efc97d79f85d895471d33c (patch) | |
tree | c7756183bb5187d92ad7113573b04ed8e2b60f49 | |
parent | 2f3d22c09ac47b49c457aabe03ac34663eebeba9 (diff) |
The 3rd approach to fix the Back button navigation. (#205)
This one should finally implement the Back button handling, without the
nasty side-effects of the other solutions (non-working Safari or
non-working closing button).
-rw-r--r-- | js/documents.js | 6 | ||||
-rw-r--r-- | js/viewer/viewer.js | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/js/documents.js b/js/documents.js index 6614044a..2ac91071 100644 --- a/js/documents.js +++ b/js/documents.js @@ -304,6 +304,10 @@ var documentsMain = { console.log('Waiting for page to render…'); return; } + + OC.Util.History.addOnPopStateHandler(_.bind(documentsMain.onClose)); + OC.Util.History.pushState(); + parent.postMessage('loading', '*'); $(document.body).addClass("claro"); @@ -433,7 +437,6 @@ var documentsMain = { // submit that $('#loleafletform').submit(); - }, hideEditor : function(){ @@ -551,7 +554,6 @@ var documentsMain = { $('footer,nav').show(); }, - onClose: function() { documentsMain.isEditorMode = false; $(window).off('beforeunload'); diff --git a/js/viewer/viewer.js b/js/viewer/viewer.js index 8bdf3950..64a95430 100644 --- a/js/viewer/viewer.js +++ b/js/viewer/viewer.js @@ -115,6 +115,8 @@ var odfViewer = { } $('#app-content #controls').removeClass('hidden'); $('#richdocumentsframe').remove(); + + OC.Util.History.replaceState(); }, registerFilesMenu: function(response) { |