From 74137446e79d74afac2aa7ca4b9e45581180496c Mon Sep 17 00:00:00 2001 From: Jason Rudolph Date: Mon, 23 Oct 2017 09:34:20 -0400 Subject: [PATCH] =?UTF-8?q?:memo:=E2=98=A0=E2=98=95=20Decaffeinate=20Toolt?= =?UTF-8?q?ipManager=20API=20docs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tooltip-manager.js | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/tooltip-manager.js b/src/tooltip-manager.js index a27b860b0..73a58d1d6 100644 --- a/src/tooltip-manager.js +++ b/src/tooltip-manager.js @@ -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 {