Mailspring/internal_packages/message-list/lib/main.cjsx
Halla Moore 1c675935a7 feat(popout-threads) Add functionality to open threads in popout windows
Summary:
Threads can now be opened in separate windows. This can be done via the popout
icon next to the print icon, or by double-clicking the thread when in double-
pane mode. Note that the single-click action is still fired, which is why
double-clicking does not work in single-pane mode. The popout icon changes to a
pop-in icon while in the popout window, to allow users to collapse it back into
the main window.

Test Plan: Tested locally

Reviewers: evan, juan

Reviewed By: juan

Subscribers: sdw

Differential Revision: https://phab.nylas.com/D3332
2016-10-12 13:55:11 -07:00

42 lines
1.5 KiB
CoffeeScript

{ComponentRegistry,
ExtensionRegistry,
WorkspaceStore,
DatabaseStore,
Actions,
Thread} = require 'nylas-exports'
MessageList = require("./message-list")
MessageListHiddenMessagesToggle = require('./message-list-hidden-messages-toggle').default
SidebarPluginContainer = require "./sidebar-plugin-container"
SidebarParticipantPicker = require('./sidebar-participant-picker').default
module.exports =
activate: ->
if NylasEnv.isMainWindow()
# Register Message List Actions we provide globally
ComponentRegistry.register MessageList,
location: WorkspaceStore.Location.MessageList
ComponentRegistry.register SidebarParticipantPicker,
location: WorkspaceStore.Location.MessageListSidebar
ComponentRegistry.register SidebarPluginContainer,
location: WorkspaceStore.Location.MessageListSidebar
ComponentRegistry.register MessageListHiddenMessagesToggle,
role: 'MessageListHeaders'
else
# This is for the thread-popout window.
ComponentRegistry.register(MessageList, {location: WorkspaceStore.Location.Center})
threadId = NylasEnv.getWindowProps().threadId;
# We need to locate the thread and focus it so that the MessageList displays it
DatabaseStore.find(Thread, threadId).then((thread) =>
Actions.setFocus({collection: 'thread', item: thread})
)
deactivate: ->
ComponentRegistry.unregister MessageList
ComponentRegistry.unregister SidebarPluginContainer
ComponentRegistry.unregister SidebarParticipantPicker