Skip to content

Commit 9d05058

Browse files
authored
Disable AddCellLine if notebook is untrusted (#12905)
1 parent ebcc840 commit 9d05058

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/datascience-ui/native-editor/addCellLine.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,23 @@ export class AddCellLine extends React.Component<IAddCellLineProps> {
2525
const plus = this.props.includePlus ? (
2626
<Image baseTheme={this.props.baseTheme} class="image-button-image" image={ImageName.InsertBelow} />
2727
) : null;
28+
const disabled = !this.props.isNotebookTrusted;
29+
const innerFilter = disabled ? 'image-button-inner-disabled-filter' : '';
2830
return (
2931
<div className={className}>
3032
<button
3133
role="button"
3234
aria-pressed="false"
3335
title={tooltip}
34-
disabled={!this.props.isNotebookTrusted}
36+
disabled={disabled}
3537
aria-label={tooltip}
3638
className="add-cell-line-button"
3739
onClick={this.props.click}
3840
>
39-
{plus}
40-
<span className="add-cell-line-divider" />
41+
<span className={innerFilter}>
42+
{plus}
43+
<span className="add-cell-line-divider" />
44+
</span>
4145
</button>
4246
</div>
4347
);

0 commit comments

Comments
 (0)