Skip to content

Commit

Permalink
Updating data attributes to include those necessary for file icons
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Apr 10, 2015
1 parent 2a4081b commit 2539372
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/tabs/tab-view.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class TabView extends View
@item.on? 'title-changed', =>
@updateTitle()
@updateTooltip()
@updateDataAttributes()

@item.on? 'icon-changed', =>
@updateIcon()
Expand All @@ -26,6 +27,7 @@ class TabView extends View
@updateIcon()
@updateModifiedStatus()
@updateTooltip()
@updateDataAttributes()

updateTooltip: ->
@destroyTooltip()
Expand Down Expand Up @@ -56,6 +58,18 @@ class TabView extends View
@title.text(title)
@updatingTitle = false

updateDataAttributes: ->
return if @updatingDataAttributes
@updatingDataAttributes = true

if @item.getPath?
itemPath = @item.getPath()
name = path.basename(itemPath)
@title.attr 'data-path', itemPath
@title.attr 'data-name', name

@updatingDataAttributes = false

updateIcon: ->
if @iconName
@title.removeClass "icon icon-#{@iconName}"
Expand Down

0 comments on commit 2539372

Please sign in to comment.