Skip to content

Commit

Permalink
Canvas: Remove Open Editor option from context menu when in normal ed…
Browse files Browse the repository at this point in the history
…itor mode grafana#52186
  • Loading branch information
nmarrs authored Jul 13, 2022
1 parent 2520d8f commit eb5a96e
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions public/app/plugins/panel/canvas/CanvasContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,22 @@ export const CanvasContextMenu = ({ scene }: Props) => {
}}
className={styles.menuItem}
/>
<MenuItem
label={inlineEditorOpen ? 'Close Editor' : 'Open Editor'}
onClick={() => {
if (scene.inlineEditingCallback) {
if (inlineEditorOpen) {
activePanel.panel.inlineEditButtonClose();
} else {
scene.inlineEditingCallback();
{!scene.isPanelEditing && (
<MenuItem
label={inlineEditorOpen ? 'Close Editor' : 'Open Editor'}
onClick={() => {
if (scene.inlineEditingCallback) {
if (inlineEditorOpen) {
activePanel.panel.inlineEditButtonClose();
} else {
scene.inlineEditingCallback();
}
}
}
closeContextMenu();
}}
className={styles.menuItem}
/>
closeContextMenu();
}}
className={styles.menuItem}
/>
)}
</>
);
};
Expand Down

0 comments on commit eb5a96e

Please sign in to comment.