Skip to content
Snippets Groups Projects
Commit fab4102c authored by Vincent Petry's avatar Vincent Petry
Browse files

Disabled ajax mode for public files view

Ajax loading is not supported yet for public files view.
This fix disabled the history API, ajax loading and ajax directory
switch in public mode until it is implemented properly.
parent 09b084df
Branches
No related tags found
No related merge requests found
......@@ -677,6 +677,7 @@ var FileList={
};
$(document).ready(function(){
var isPublic = !!$('#isPublic').val();
// handle upload events
var file_upload_start = $('#file_upload_start');
......@@ -924,6 +925,8 @@ $(document).ready(function(){
return (params && params.dir) || '/';
}
// disable ajax/history API for public app (TODO: until it gets ported)
if (!isPublic){
// fallback to hashchange when no history support
if (!window.history.pushState){
$(window).on('hashchange', function(){
......@@ -948,6 +951,7 @@ $(document).ready(function(){
// need to initially switch the dir to the one from the hash (IE8)
FileList.changeDirectory(parseCurrentDirFromUrl(), false, true);
}
}
FileList.createFileSummary();
});
......@@ -705,7 +705,9 @@ function checkTrashStatus() {
function onClickBreadcrumb(e){
var $el = $(e.target).closest('.crumb'),
$targetDir = $el.data('dir');
if ($targetDir !== undefined){
isPublic = !!$('#isPublic').val();
if ($targetDir !== undefined && !isPublic){
e.preventDefault();
FileList.changeDirectory(decodeURIComponent($targetDir));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment