提交 97af4fb3 编写于 作者: R rebornix

re #103454. notebook/comments/find remove toggle.

上级 737d2c33
......@@ -314,7 +314,7 @@ export abstract class SimpleFindReplaceWidget extends Widget {
this._replaceBtn.setEnabled(this._isVisible && this._isReplaceVisible && findInputIsNonEmpty);
this._replaceAllBtn.setEnabled(this._isVisible && this._isReplaceVisible && findInputIsNonEmpty);
dom.toggleClass(this._domNode, 'replaceToggled', this._isReplaceVisible);
this._domNode.classList.toggle('replaceToggled', this._isReplaceVisible);
this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);
}
......
......@@ -113,7 +113,7 @@ export class CommentsPanel extends ViewPane {
}
private async renderComments(): Promise<void> {
dom.toggleClass(this.treeContainer, 'hidden', !this.commentsModel.hasCommentThreads());
this.treeContainer.classList.toggle('hidden', !this.commentsModel.hasCommentThreads());
await this.tree.setInput(this.commentsModel);
this.renderMessage();
}
......@@ -144,7 +144,7 @@ export class CommentsPanel extends ViewPane {
private renderMessage(): void {
this.messageBox.textContent = this.commentsModel.getMessage();
dom.toggleClass(this.messageBoxContainer, 'hidden', this.commentsModel.hasCommentThreads());
this.messageBoxContainer.classList.toggle('hidden', this.commentsModel.hasCommentThreads());
}
private createTree(): void {
......@@ -237,7 +237,7 @@ export class CommentsPanel extends ViewPane {
this.collapseAllAction.enabled = this.commentsModel.hasCommentThreads();
}
dom.toggleClass(this.treeContainer, 'hidden', !this.commentsModel.hasCommentThreads());
this.treeContainer.classList.toggle('hidden', !this.commentsModel.hasCommentThreads());
this.tree.updateChildren().then(() => {
this.renderMessage();
}, (e) => {
......
......@@ -861,8 +861,8 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
const notebookMetadata = this.viewModel!.metadata;
this._editorEditable?.set(!!notebookMetadata?.editable);
this._editorRunnable?.set(!!notebookMetadata?.runnable);
DOM.toggleClass(this._overlayContainer, 'notebook-editor-editable', !!notebookMetadata?.editable);
DOM.toggleClass(this.getDomNode(), 'notebook-editor-editable', !!notebookMetadata?.editable);
this._overflowContainer.classList.toggle('notebook-editor-editable', !!notebookMetadata?.editable);
this.getDomNode().classList.toggle('notebook-editor-editable', !!notebookMetadata?.editable);
this._notebookExecuting?.set(notebookMetadata.runState === NotebookRunState.Running);
}
......
......@@ -186,7 +186,7 @@ class RichRenderer implements IOutputTransformContribution {
const image = document.createElement('img');
image.src = `data:image/png;base64,${output.data['image/png']}`;
const display = document.createElement('div');
DOM.addClasses(display, 'display');
display.classList.add('display');
display.appendChild(image);
container.appendChild(display);
return { type: RenderOutputType.None, hasDynamicHeight: true };
......@@ -196,7 +196,7 @@ class RichRenderer implements IOutputTransformContribution {
const image = document.createElement('img');
image.src = `data:image/jpeg;base64,${output.data['image/jpeg']}`;
const display = document.createElement('div');
DOM.addClasses(display, 'display');
display.classList.add('display');
display.appendChild(image);
container.appendChild(display);
return { type: RenderOutputType.None, hasDynamicHeight: true };
......
......@@ -785,7 +785,7 @@ export class CodeCellRenderer extends AbstractCellRenderer implements IListRende
private updateForMetadata(element: CodeCellViewModel, templateData: CodeCellRenderTemplate): void {
const metadata = element.getEvaluatedMetadata(this.notebookEditor.viewModel!.notebookDocument.metadata);
DOM.toggleClass(templateData.container, 'runnable', !!metadata.runnable);
templateData.container.classList.toggle('runnable', !!metadata.runnable);
this.updateExecutionOrder(metadata, templateData);
templateData.statusBar.cellStatusMessageContainer.textContent = metadata?.statusMessage || '';
......@@ -826,7 +826,7 @@ export class CodeCellRenderer extends AbstractCellRenderer implements IListRende
}
private updateForHover(element: CodeCellViewModel, templateData: CodeCellRenderTemplate): void {
DOM.toggleClass(templateData.container, 'cell-output-hover', element.outputIsHovered);
templateData.container.classList.toggle('cell-output-hover', element.outputIsHovered);
}
private updateForLayout(element: CodeCellViewModel, templateData: CodeCellRenderTemplate): void {
......
......@@ -84,7 +84,7 @@ export class CodeCell extends Disposable {
templateData.editor?.focus();
}
DOM.toggleClass(templateData.container, 'cell-editor-focus', viewCell.focusMode === CellFocusMode.Editor);
templateData.container.classList.toggle('cell-editor-focus', viewCell.focusMode === CellFocusMode.Editor);
};
const updateForCollapseState = () => {
this.viewUpdate();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册