From 3215508a0b72f0723fca9a4f12c985cbc2da40a1 Mon Sep 17 00:00:00 2001 From: Jason Grout Date: Fri, 24 May 2019 10:53:44 -0700 Subject: [PATCH] Hide the Last Modified column on a narrow filebrowser. Fixes #6093 --- packages/filebrowser/src/listing.ts | 6 ++++++ packages/filebrowser/style/index.css | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/packages/filebrowser/src/listing.ts b/packages/filebrowser/src/listing.ts index 8c81104ea813..e799015e4529 100644 --- a/packages/filebrowser/src/listing.ts +++ b/packages/filebrowser/src/listing.ts @@ -786,6 +786,12 @@ export class DirListing extends Widget { this._prevPath = this._model.path; } + onResize(msg: Widget.ResizeMessage) { + const { width } = + msg.width === -1 ? this.node.getBoundingClientRect() : msg; + this.toggleClass('jp-DirListing-narrow', width < 250); + } + /** * Handle the `'click'` event for the widget. */ diff --git a/packages/filebrowser/style/index.css b/packages/filebrowser/style/index.css index efa3cdb404f4..6b537aa3b1ab 100644 --- a/packages/filebrowser/style/index.css +++ b/packages/filebrowser/style/index.css @@ -120,6 +120,10 @@ text-align: right; } +.jp-DirListing-narrow .jp-id-modified, .jp-DirListing-narrow .jp-DirListing-itemModified { + display: none; +} + .jp-DirListing-headerItem.jp-mod-selected { font-weight: 600; }