diff options
Diffstat (limited to 'apps/files_trashbin/js')
-rw-r--r-- | apps/files_trashbin/js/filelist.js | 29 | ||||
-rw-r--r-- | apps/files_trashbin/js/trash.js | 14 |
2 files changed, 42 insertions, 1 deletions
diff --git a/apps/files_trashbin/js/filelist.js b/apps/files_trashbin/js/filelist.js new file mode 100644 index 00000000000..ff3a846d860 --- /dev/null +++ b/apps/files_trashbin/js/filelist.js @@ -0,0 +1,29 @@ +// override reload with own ajax call +FileList.reload = function(){ + FileList.showMask(); + if (FileList._reloadCall){ + FileList._reloadCall.abort(); + } + $.ajax({ + url: OC.filePath('files_trashbin','ajax','list.php'), + data: { + dir : $('#dir').val(), + breadcrumb: true + }, + error: function(result) { + FileList.reloadCallback(result); + }, + success: function(result) { + FileList.reloadCallback(result); + } + }); +} + +FileList.setCurrentDir = function(targetDir, changeUrl){ + $('#dir').val(targetDir); + // Note: IE8 handling ignored for now + if (window.history.pushState && changeUrl !== false){ + url = OC.linkTo('files_trashbin', 'index.php')+"?dir="+ encodeURIComponent(targetDir).replace(/%2F/g, '/'), + window.history.pushState({dir: targetDir}, '', url); + } +} diff --git a/apps/files_trashbin/js/trash.js b/apps/files_trashbin/js/trash.js index 40c0bdb3829..d73eadb6011 100644 --- a/apps/files_trashbin/js/trash.js +++ b/apps/files_trashbin/js/trash.js @@ -171,9 +171,15 @@ $(document).ready(function() { action(filename); } } + + // event handlers for breadcrumb items + $('#controls').delegate('.crumb:not(.home) a', 'click', onClickBreadcrumb); }); - FileActions.actions.dir = {}; + FileActions.actions.dir = { + // only keep 'Open' action for navigation + 'Open': FileActions.actions.dir.Open + }; }); function processSelection(){ @@ -246,3 +252,9 @@ function disableActions() { $(".action").css("display", "none"); $(":input:checkbox").css("display", "none"); } +function onClickBreadcrumb(e){ + var $el = $(e.target).closest('.crumb'); + e.preventDefault(); + FileList.changeDirectory(decodeURIComponent($el.data('dir'))); +} + |