Add atom.tooltips.findTooltips(target) #13493

Merged
merged 3 commits into from Dec 23, 2016

Projects

None yet

2 participants

@vjeux
Contributor
vjeux commented Dec 22, 2016

Right now, it is not possible to hide a tooltip programatically. This is useful when we know better than the tooltip implementation that we did an action that should hide it.

After discussing with @lee-dohm, he suggested the findTooltips API that mimicks the KeyMapManager API.

Released under CC0

src/tooltip-manager.coffee
disposable
+ findTooltips: (target) ->
+ if @tooltips.has(target)
+ @tooltips.get(target)
@lee-dohm
lee-dohm Dec 22, 2016 Member

I noticed that other implementations of the find pattern use slice to create a shallow copy of the array and return the copy. I assume they're doing that to prevent people from corrupting the source array. Can we use @tooltips.get(target).slice() here?

@vjeux
vjeux Dec 22, 2016 Contributor

Sure, good idea!

vjeux and others added some commits Dec 22, 2016
@vjeux vjeux Add atom.tooltips.findTooltips(target)
Right now, it is not possible to hide a tooltip programatically. This is useful when we know better than the tooltip implementation that we did an action that should hide it.

After discussing with @lee-dohm, he suggested the findTooltips API that mimicks the KeyMapManager API.

Released under CC0
a33ab44
@lee-dohm lee-dohm 📝 Add documentation for findTooltips
fd5feab
@lee-dohm lee-dohm 👕
6404970
@lee-dohm lee-dohm merged commit 3ca269e into master Dec 23, 2016

5 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@lee-dohm lee-dohm deleted the fb-vjeux-find-tooltips branch Dec 23, 2016
@lee-dohm
Member

Thanks for the help! 👍

@vjeux
Contributor
vjeux commented Dec 23, 2016

Yaaay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment