mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-11 18:32:20 +08:00
4619871e8d
Summary: Fixes: T1334 remove final InboxApp references move out all underscore-plus methods Mass find and replace of underscore-plus sed -i '' -- 's/underscore-plus/underscore/g' **/*.coffee sed -i '' -- 's/underscore-plus/underscore/g' **/*.cjsx Test Plan: edgehill --test Reviewers: bengotow Reviewed By: bengotow Differential Revision: https://phab.nylas.com/D1534
32 lines
1.2 KiB
CoffeeScript
32 lines
1.2 KiB
CoffeeScript
_ = require 'underscore'
|
|
React = require "react"
|
|
Tooltip = require "./tooltip"
|
|
{ComponentRegistry} = require("nylas-exports")
|
|
|
|
module.exports =
|
|
item: null # The DOM item the main React component renders into
|
|
|
|
activate: (@state={}) ->
|
|
@item = document.createElement("div")
|
|
@item.setAttribute("id", "tooltip-container")
|
|
@item.setAttribute("class", "tooltip-container")
|
|
@tooltip = React.render(React.createElement(Tooltip), @item)
|
|
document.querySelector(atom.workspaceViewParentSelector).appendChild(@item)
|
|
|
|
@mouseDownListener = _.bind(@tooltip.onMouseDown, @tooltip)
|
|
@mouseOverListener = _.bind(@tooltip.onMouseOver, @tooltip)
|
|
@mouseOutListener = _.bind(@tooltip.onMouseOut, @tooltip)
|
|
|
|
window.addEventListener("mousedown", @mouseDownListener)
|
|
window.addEventListener("mouseover", @mouseOverListener)
|
|
window.addEventListener("mouseout", @mouseOutListener)
|
|
|
|
deactivate: ->
|
|
React.unmountComponentAtNode(@item)
|
|
document.querySelector(atom.workspaceViewParentSelector).removeChild(@item)
|
|
|
|
window.removeEventListener("mousedown", @mouseDownListener)
|
|
window.removeEventListener("mouseover", @mouseOverListener)
|
|
window.removeEventListener("mouseout", @mouseOutListener)
|
|
|
|
serialize: -> @state
|