From 5974cbe2ad812ff49e7889af2ba0f729aa2b1edc Mon Sep 17 00:00:00 2001 From: "Brian E. Granger" Date: Sat, 25 Feb 2017 18:40:37 -0800 Subject: [PATCH] Don't show Edit button on files we know we can't edit or ipynb This removes the showing of the Edit button when: * We know we can't edit the file (pdf, doc, xls, jpeg, png, etc.) * Or a notebook - looking at this again though... --- notebook/static/tree/js/notebooklist.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/notebook/static/tree/js/notebooklist.js b/notebook/static/tree/js/notebooklist.js index b7d3921e9..a4d9cf23f 100644 --- a/notebook/static/tree/js/notebooklist.js +++ b/notebook/static/tree/js/notebooklist.js @@ -609,7 +609,9 @@ define([ } // Edit is visible when an item is editable - if (selected.length > 0 && !has_directory) { + if (selected.length > 0 && !has_directory && !selected.find(function(el) { + return el.path.match(/ipynb||jpe?g|png|gif|tiff?|bmp|ico|pdf|doc|xls/); + })) { $('.edit-button').css('display', 'inline-block'); } else { $('.edit-button').css('display', 'none');