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

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

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