Skip to content
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

fix toolbar visible when readonly #69

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/renderer/renderer/src/codeBlockNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const codeBlockNode = options => {
attributes,
children,
node,
readOnly,
editor
}: nodeProps) => {
const syntax = options.getSyntax(node);
Expand All @@ -45,6 +46,7 @@ export const codeBlockNode = options => {
style={{ minWidth: "80px" }}
defaultValue={syntax || "TXT"}
size="small"
disabled={readOnly}
>
{Object.keys(languages)
.filter(lang => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default class ImageContainer extends React.Component<Props, State> {
isEditing
} = this.props;
const src = getSrc(node);
const active = isSelected || readOnly;
const active = isSelected && !readOnly;

return (
<span>
Expand Down
2 changes: 1 addition & 1 deletion packages/renderer/renderer/src/videoNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class VideoNode extends React.Component<Props, State> {
const id = getId(node);
const width = this.state.width || getWidth(node) || 560;
const height = this.state.height || getHeight(node) || 315;
const active = isSelected || readOnly;
const active = isSelected && !readOnly;
if (type === "youtube") {
link = `https://www.youtube.com/embed/${id}`;
} else if (type === "dailymotion") {
Expand Down