mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-22 16:26:08 +08:00
1c675935a7
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
42 lines
1.5 KiB
CoffeeScript
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
|