From 3b08721835758881852e273c8f59172d46995c08 Mon Sep 17 00:00:00 2001
From: Yurong He <43652751+YurongHe@users.noreply.github.com>
Date: Fri, 7 Dec 2018 09:02:20 -0800
Subject: [PATCH] Fixed #3415 add padding-left/right 8px (#3462)
* Fixed #3415 add padding-left/right 8px
* We will keep CSS consistent for review and editing mode. So removed codes not used.
---
.../cellViews/textCell.component.html | 2 +-
.../notebook/cellViews/textCell.component.ts | 19 +------------------
src/sql/parts/notebook/cellViews/textCell.css | 2 ++
3 files changed, 4 insertions(+), 19 deletions(-)
diff --git a/src/sql/parts/notebook/cellViews/textCell.component.html b/src/sql/parts/notebook/cellViews/textCell.component.html
index d9457a4f4a..05b735c123 100644
--- a/src/sql/parts/notebook/cellViews/textCell.component.html
+++ b/src/sql/parts/notebook/cellViews/textCell.component.html
@@ -9,6 +9,6 @@
-
diff --git a/src/sql/parts/notebook/cellViews/textCell.component.ts b/src/sql/parts/notebook/cellViews/textCell.component.ts
index a8fa274db4..6bb57c3468 100644
--- a/src/sql/parts/notebook/cellViews/textCell.component.ts
+++ b/src/sql/parts/notebook/cellViews/textCell.component.ts
@@ -38,7 +38,6 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges {
private _content: string;
private isEditMode: boolean;
private _sanitizer: ISanitizer;
- private _previewCssApplied: boolean = false;
private _model: NotebookModel;
private _activeCellId: string;
@@ -127,29 +126,13 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges {
}
public handleContentChanged(): void {
- if (!this._previewCssApplied) {
- this.updatePreviewCssClass();
- }
this.updatePreview();
}
public toggleEditMode(editMode?: boolean): void {
this.isEditMode = editMode !== undefined? editMode : !this.isEditMode;
- this.updatePreviewCssClass();
+
this.updatePreview();
this._changeRef.detectChanges();
}
-
- // Updates the css class to preview 'div' based on edit mode
- private updatePreviewCssClass() {
- let outputElement = this.output.nativeElement;
- if (this.isEditMode && this.cellModel.source) {
- outputElement.className = 'notebook-preview';
- this._previewCssApplied = true;
- }
- else {
- outputElement.className = '';
- this._previewCssApplied = false;
- }
- }
}
diff --git a/src/sql/parts/notebook/cellViews/textCell.css b/src/sql/parts/notebook/cellViews/textCell.css
index df8a1dca3e..bb2b57b980 100644
--- a/src/sql/parts/notebook/cellViews/textCell.css
+++ b/src/sql/parts/notebook/cellViews/textCell.css
@@ -11,4 +11,6 @@ text-cell-component .notebook-preview {
border-top-width: 1px;
border-top-style: solid;
user-select: initial;
+ padding-left: 8px;
+ padding-right: 8px;
}
\ No newline at end of file