Use /files prefix for PDF-like files

This commit is contained in:
Grant Nestor 2017-11-09 15:52:35 -08:00
parent 11838000fb
commit 009af0e833

View File

@ -563,6 +563,12 @@ define([
return model.mimetype === 'text/html'
|| includes_extension(model.path, viewable_extensions);
};
// Files like PDF that should be opened using `/files` prefix
NotebookList.prototype._is_pdflike = function(model) {
var pdflike_extensions = ['pdf'];
return includes_extension(model.path, pdflike_extensions);
};
/**
* Handles when any row selector checkbox is toggled.
@ -732,6 +738,10 @@ define([
{
uri_prefix = 'view';
}
if (model.type === 'file' && this._is_pdflike(model))
{
uri_prefix = 'files';
}
if (model.type === 'file' && this._is_notebook(model))
{
uri_prefix = 'notebooks';