Browse Source

Merge pull request #8393 from nyu-ossd-s20/hidden-file-ux

Dim dot files in filebrowser
Steven Silvester 5 years ago
parent
commit
5af220eeed
2 changed files with 10 additions and 1 deletions
  1. 6 1
      packages/filebrowser/src/listing.ts
  2. 4 0
      packages/filebrowser/style/base.css

+ 6 - 1
packages/filebrowser/src/listing.ts

@@ -944,6 +944,7 @@ export class DirListing extends Widget {
       this._manager.openOrReveal(path);
     }
   }
+
   /**
    * Handle the `'keydown'` event for the widget.
    */
@@ -1872,7 +1873,11 @@ export namespace DirListing {
 
       node.title = hoverText;
       node.setAttribute('data-file-type', name);
-
+      if (model.name.startsWith('.')) {
+        node.setAttribute('data-is-dot', 'true');
+      } else {
+        node.removeAttribute('data-is-dot');
+      }
       // If an item is being edited currently, its text node is unavailable.
       if (text && text.textContent !== model.name) {
         text.textContent = model.name;

+ 4 - 0
packages/filebrowser/style/base.css

@@ -156,6 +156,10 @@
   user-select: none;
 }
 
+.jp-DirListing-item[data-is-dot] {
+  opacity: 75%;
+}
+
 .jp-DirListing-item.jp-mod-selected {
   color: white;
   background: var(--jp-brand-color1);