Skip to content

Commit c9a7795

Browse files
authored
Merge pull request #3031 from gnestor/edit-view-pdf
Use `/files` prefix for PDF-like files
2 parents bbf0ead + 009af0e commit c9a7795

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

notebook/static/tree/js/notebooklist.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,12 @@ define([
563563
return model.mimetype === 'text/html'
564564
|| includes_extension(model.path, viewable_extensions);
565565
};
566+
567+
// Files like PDF that should be opened using `/files` prefix
568+
NotebookList.prototype._is_pdflike = function(model) {
569+
var pdflike_extensions = ['pdf'];
570+
return includes_extension(model.path, pdflike_extensions);
571+
};
566572

567573
/**
568574
* Handles when any row selector checkbox is toggled.
@@ -732,6 +738,10 @@ define([
732738
{
733739
uri_prefix = 'view';
734740
}
741+
if (model.type === 'file' && this._is_pdflike(model))
742+
{
743+
uri_prefix = 'files';
744+
}
735745
if (model.type === 'file' && this._is_notebook(model))
736746
{
737747
uri_prefix = 'notebooks';

0 commit comments

Comments
 (0)