fix back button navigation (#183)
now backbutton when document is opened takes you back to the files app from where the document was opened.
This commit is contained in:
parent
871c866f0d
commit
4b980cb010
@ -107,6 +107,22 @@ var odfViewer = {
|
|||||||
|
|
||||||
$('#app-content #controls').addClass('hidden');
|
$('#app-content #controls').addClass('hidden');
|
||||||
$('#app-content').append($iframe);
|
$('#app-content').append($iframe);
|
||||||
|
window.location.assign(window.location.href + '#richdocuments');
|
||||||
|
|
||||||
|
window.addEventListener('hashchange', function(e) {
|
||||||
|
// handle double hash (eg: ##richdocuments)
|
||||||
|
var hash = window.location.hash.replace(/#/g, '');
|
||||||
|
// unload
|
||||||
|
if (hash !== 'richdocuments') {
|
||||||
|
odfViewer.onClose();
|
||||||
|
}
|
||||||
|
// load
|
||||||
|
else if (hash === 'richdocuments' && $('#richdocumentsframe').length === 0) {
|
||||||
|
$('#app-content #controls').addClass('hidden');
|
||||||
|
$('#app-navigation').addClass('hidden');
|
||||||
|
$('#app-content').append($iframe);
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onClose: function() {
|
onClose: function() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user