Skip to content

Commit

Permalink
add half-assed tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Metzdorf committed Jun 29, 2015
1 parent 835c2c0 commit 1432edd
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/file-info-view.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,20 @@ class FileInfoView extends HTMLElement
@bufferModified.classList.add('buffer-modified')
@appendChild(@bufferModified)

@absolutePath = @getActiveItem()?.getPath?()


clickHandler = ->
atom.clipboard.write('helloworld')
@tempTip = atom.tooltips.add(this,
title: 'Copied: '+atom.clipboard.read(),
trigger: 'click',
delay:
show: 0
hide: 1000
)
killTip = => @tempTip.dispose()
atom.clipboard.write(@absolutePath)
setTimeout(killTip, 1000)

@addEventListener('click', clickHandler)
@clickSubscription = new Disposable => @removeEventListener('click', clickHandler)
Expand Down Expand Up @@ -46,6 +58,7 @@ class FileInfoView extends HTMLElement
@titleSubscription?.dispose()
@modifiedSubscription?.dispose()
@clickSubscription?.dispose()
@tempTip?.dispose()

getActiveItem: ->
atom.workspace.getActivePaneItem()
Expand Down

0 comments on commit 1432edd

Please sign in to comment.