mirror of
https://github.com/atom/atom.git
synced 2026-02-06 20:55:33 -05:00
:memo:☠☕ Decaffeinate TooltipManager API docs
This commit is contained in:
@@ -10,38 +10,39 @@ let Tooltip = null
|
||||
//
|
||||
// The essence of displaying a tooltip
|
||||
//
|
||||
// ```coffee
|
||||
// # display it
|
||||
// disposable = atom.tooltips.add(div, {title: 'This is a tooltip'})
|
||||
// ```javascript
|
||||
// // display it
|
||||
// const disposable = atom.tooltips.add(div, {title: 'This is a tooltip'})
|
||||
//
|
||||
// # remove it
|
||||
// // remove it
|
||||
// disposable.dispose()
|
||||
// ```
|
||||
//
|
||||
// In practice there are usually multiple tooltips. So we add them to a
|
||||
// CompositeDisposable
|
||||
//
|
||||
// ```coffee
|
||||
// {CompositeDisposable} = require 'atom'
|
||||
// subscriptions = new CompositeDisposable
|
||||
// ```javascript
|
||||
// const {CompositeDisposable} = require('atom')
|
||||
// const subscriptions = new CompositeDisposable()
|
||||
//
|
||||
// div1 = document.createElement('div')
|
||||
// div2 = document.createElement('div')
|
||||
// subscriptions.add atom.tooltips.add(div1, {title: 'This is a tooltip'})
|
||||
// subscriptions.add atom.tooltips.add(div2, {title: 'Another tooltip'})
|
||||
// const div1 = document.createElement('div')
|
||||
// const div2 = document.createElement('div')
|
||||
// subscriptions.add(atom.tooltips.add(div1, {title: 'This is a tooltip'}))
|
||||
// subscriptions.add(atom.tooltips.add(div2, {title: 'Another tooltip'}))
|
||||
//
|
||||
// # remove them all
|
||||
// // remove them all
|
||||
// subscriptions.dispose()
|
||||
// ```
|
||||
//
|
||||
// You can display a key binding in the tooltip as well with the
|
||||
// `keyBindingCommand` option.
|
||||
//
|
||||
// ```coffee
|
||||
// disposable = atom.tooltips.add @caseOptionButton,
|
||||
// title: "Match Case"
|
||||
// keyBindingCommand: 'find-and-replace:toggle-case-option'
|
||||
// keyBindingTarget: @findEditor.element
|
||||
// ```javascript
|
||||
// disposable = atom.tooltips.add(this.caseOptionButton, {
|
||||
// title: 'Match Case',
|
||||
// keyBindingCommand: 'find-and-replace:toggle-case-option',
|
||||
// keyBindingTarget: this.findEditor.element
|
||||
// })
|
||||
// ```
|
||||
module.exports =
|
||||
class TooltipManager {
|
||||
|
||||
Reference in New Issue
Block a user