Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Disable AddCellLine if notebook is untrusted (#12905)
  • Loading branch information
joyceerhl authored and DonJayamanne committed Jul 13, 2020
commit 5b7eb61780433d086e867a9fb4dac3d36ff87a1d
10 changes: 7 additions & 3 deletions src/datascience-ui/native-editor/addCellLine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,23 @@ export class AddCellLine extends React.Component<IAddCellLineProps> {
const plus = this.props.includePlus ? (
<Image baseTheme={this.props.baseTheme} class="image-button-image" image={ImageName.InsertBelow} />
) : null;
const disabled = !this.props.isNotebookTrusted;
const innerFilter = disabled ? 'image-button-inner-disabled-filter' : '';
return (
<div className={className}>
<button
role="button"
aria-pressed="false"
title={tooltip}
disabled={!this.props.isNotebookTrusted}
disabled={disabled}
aria-label={tooltip}
className="add-cell-line-button"
onClick={this.props.click}
>
{plus}
<span className="add-cell-line-divider" />
<span className={innerFilter}>
{plus}
<span className="add-cell-line-divider" />
</span>
</button>
</div>
);
Expand Down