-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Inline Commenting: Added new sidebar as extension of the canvas #67347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
35c9f23
f1d7e1c
b1f0488
c60972c
06c49ba
d096211
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| export const collabHistorySidebarName = 'edit-post/collab-history-sidebar'; | ||
| export const collabSidebarName = 'edit-post/collab-sidebar'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,3 +7,21 @@ | |
| export function sanitizeCommentString( str ) { | ||
| return str.trim(); | ||
| } | ||
|
|
||
| /** | ||
| * Gets the background color of the editor canvas. | ||
| * | ||
| * @return { string } Background color of the editor canvas. | ||
| */ | ||
| export function getEditorCanvasBackgroundColor() { | ||
| const iframe = document.querySelector( 'iframe[name="editor-canvas"]' ); | ||
| const iframeDocument = | ||
| iframe?.contentDocument || iframe?.contentWindow.document; | ||
| const iframeBody = iframeDocument?.body; | ||
| if ( iframeBody ) { | ||
| const style = window.getComputedStyle( iframeBody ); | ||
| return style?.backgroundColor; | ||
|
||
| } | ||
|
|
||
| return ''; | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving the selector in the parent component re-introduces the performance issue fixed in #66670. We should be careful and avoid introducing similar regressions in the future.
P.S. I'm working on a fix and will create a PR shortly.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I didn't notice this. We now have two sidebars with separate comment orders, thus I had to transfer selector to the parent component.