You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 3, 2023. It is now read-only.
Currently there are 2 static methods on the Frame class, isReady() and toggle(). These are useful, but for our use case we also need a way of detecting if the sidebar is open or minimized, for example isOpen().
This being because we have some code that runs that opens the sidebar. If isReady() === true we run toggle(), however we don't want to toggle if it the user has the sidebar open already.
Currently to achieve this I've got some hacky code:
if(Frame.isReady()){// only toggle frame if it's not openconstiframeEl=document.getElementById("iframe-id");if(iframeEl){constparentStyles=window.getComputedStyle(iframeEl.parentNode);constparentTransform=parentStyles.transform;constisMinimized=parentTransform!=="matrix(1, 0, 0, 1, 0, 0)";if(isMinimized){Frame.toggle();}}}else{constroot=document.createElement("div");document.body.appendChild(root);ReactDOM.render(<App/>,root);}
Currently there are 2 static methods on the
Frameclass,isReady()andtoggle(). These are useful, but for our use case we also need a way of detecting if the sidebar is open or minimized, for exampleisOpen().This being because we have some code that runs that opens the sidebar. If
isReady() === truewe runtoggle(), however we don't want to toggle if it the user has the sidebar open already.Currently to achieve this I've got some hacky code: