Commit 59ae032d authored by Scott Wittenburg's avatar Scott Wittenburg Committed by David E. DeMarle

Added code to support a cache option for filebrowser widget.

This new option will allow code that uses the filebrowser to specify
whether or not to cache files read from the server when clicking on
a path.  If not using cache, files will be re-read from the server.

Change-Id: Ife4cc398d8589345b61f044b4a855d4246f54b5a
parent e8746067
......@@ -69,6 +69,7 @@
me.append(container);
me.data('file-list', opts.data);
me.data('session', opts.session);
me.data('cacheFiles', opts.cacheFiles);
if(opts.data === null) {
opts.session.call('vtk:listServerDirectory','.').then(function(files) {
......@@ -140,7 +141,8 @@
$.fn.fileBrowser.defaults = {
template: "#vtk-templates > .vtkweb-widget-filebrowser > div",
session: null,
data: null
data: null,
cacheFiles: true
};
// =======================================================================
......@@ -207,6 +209,9 @@
$('.vtk-directory', container).removeClass('active');
newActive.addClass('active');
}
if (container.data('cacheFiles') === false) {
container.updateFileBrowser(newPath);
}
} else if(type === 'dir') {
// Swicth active panel
var str = '.vtk-directory[path="' + pathStr + pathSeparator + item.html() + '"]';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment