diff --git a/lib/ui/FileBrowser.js b/lib/ui/FileBrowser.js index aa69d77..745fa09 100644 --- a/lib/ui/FileBrowser.js +++ b/lib/ui/FileBrowser.js @@ -19,6 +19,18 @@ function FileBrowser (opts) { keys: true, mouse: true }).merge(opts).toObject()); + + // Add hover text to filenames that are too long for the panel: + self.on('refresh', function() { + for (var i = 0; i < self.items.length; i++) { + if (self.items[i].getText().length > self.items[i].width) { + self.items[i].setHover(self.items[i].getContent()); + } else { + self.items[i].removeHover(); + } + } + }); + self.refresh(); self.data.selectedStyle = self.style.selected; self.data.itemStyle = self.style.item;