mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 15:27:47 -02:30
disable interactive elements of CodeEditor in readOnly mode
This commit is contained in:
@@ -44,6 +44,14 @@ const AceEditor = styled(ReactAce)`
|
|||||||
background: var(--pf-c-form-control--invalid--Background);
|
background: var(--pf-c-form-control--invalid--Background);
|
||||||
border-bottom-width: var(--pf-c-form-control--invalid--BorderBottomWidth);
|
border-bottom-width: var(--pf-c-form-control--invalid--BorderBottomWidth);
|
||||||
}`}
|
}`}
|
||||||
|
|
||||||
|
${props =>
|
||||||
|
props.setOptions.readOnly &&
|
||||||
|
`
|
||||||
|
&& .ace_cursor {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
`}
|
||||||
`;
|
`;
|
||||||
AceEditor.displayName = 'AceEditor';
|
AceEditor.displayName = 'AceEditor';
|
||||||
|
|
||||||
@@ -132,6 +140,8 @@ function CodeEditor({
|
|||||||
hasErrors={hasErrors}
|
hasErrors={hasErrors}
|
||||||
setOptions={{
|
setOptions={{
|
||||||
readOnly,
|
readOnly,
|
||||||
|
highlightActiveLine: !readOnly,
|
||||||
|
highlightGutterLine: !readOnly,
|
||||||
useWorker: false,
|
useWorker: false,
|
||||||
}}
|
}}
|
||||||
commands={[
|
commands={[
|
||||||
|
|||||||
Reference in New Issue
Block a user