Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customizable panel title #22

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions lib/tree-view-open-files-pane-view.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ class TreeViewOpenFilesPaneView
@items = []
@activeItem = null
@paneSub = new CompositeDisposable

# -----------------------------------------------------------------------------------------------------------
# Agustin Ignacio Kanner <[email protected]>
@headerSpan = document.createElement('span')
@headerSpan.classList.add('name', 'icon', 'icon-file-directory')
@headerSpan.setAttribute('data-name', 'Pane')
#defines a callback for the event that will be produced when the title of the pane change in the configuration
@NameChangeEventSubscription = atom.config.observe 'tree-view-open-files.title',
(title) => @headerSpan.innerText = title
#-------------------------------------------------------------------------------------------------------------
@element = document.createElement('ul')
@element.classList.add('list-tree', 'has-collapsable-children')
nested = document.createElement('li')
Expand All @@ -17,12 +25,7 @@ class TreeViewOpenFilesPaneView
@container.classList.add('list-tree')
header = document.createElement('div')
header.classList.add('list-item')

headerSpan = document.createElement('span')
headerSpan.classList.add('name', 'icon', 'icon-file-directory')
headerSpan.setAttribute('data-name', 'Pane')
headerSpan.innerText = 'Pane'
header.appendChild headerSpan
header.appendChild @headerSpan
nested.appendChild header
nested.appendChild @container
@element.appendChild nested
Expand Down Expand Up @@ -124,3 +127,4 @@ class TreeViewOpenFilesPaneView
destroy: ->
@element.remove()
@paneSub.dispose()
@NameChangeEventSubscription.dispose()
5 changes: 5 additions & 0 deletions lib/tree-view-open-files.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ module.exports =
default: 250
min: 0
description: 'Maximum height of the list before scrolling is required. Set to 0 to disable scrolling.'
# Agustin Ignacio Kanner <[email protected]>
title:
type: 'string'
default: 'WORKING FILES'
description: 'Title of the panel'

activate: (state) ->
requirePackages('tree-view').then ([treeView]) =>
Expand Down