1

I'm using InboxSDK to add sidebar to thread view on GMail.

I do it like this:

InboxSDK.load(2, 'MY_KEY').then(sdk => {
    sdk.Conversations.registerThreadViewHandler(threadView => {
        const el = document.createElement("div");
        el.id = 'mySidebar';
        ReactDOM.render(<App />, el);

        threadView.addSidebarContentPanel({
            title: 'Sidebar Example',
            iconUrl:chrome.extension.getURL('icon.png'),
            hideTitleBar:true,
            el:el
        });
    });
});

But I couldn't find any setting in InboxSDK docs that would enable me to show this panel as collapsed after it's created. Is it possible, or should I do it the dirty way, by adding/removing classes from elements manually?

kecman
  • 813
  • 3
  • 14
  • 34

1 Answers1

0

How about trigger a click event on the button programmatically if the sidebar is opened?

if ($('.companion_app_sidebar_wrapper_visible').length > 0) {
    $('.sidebar_thread_iconArea button[data-tooltip="Sidebar Example"]').trigger('click');
}