From de5a91a13f782f9af9fe8788f5ca94dda04119a9 Mon Sep 17 00:00:00 2001 From: Chris LaFreniere <40371649+chlafreniere@users.noreply.github.com> Date: Wed, 5 Dec 2018 13:22:56 -0800 Subject: [PATCH] Allow for Notebook Cell Unselection (#3460) * Allow for cell unselection * PR Feedback: use event.stopPropagation() when multiple events can fire * Ensure markdown goes into Preview mode when cell not selected --- .../notebook/cellViews/textCell.component.ts | 6 ++---- src/sql/parts/notebook/notebook.component.html | 4 ++-- src/sql/parts/notebook/notebook.component.ts | 15 ++++++++++++++- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/sql/parts/notebook/cellViews/textCell.component.ts b/src/sql/parts/notebook/cellViews/textCell.component.ts index 963b632ff9..a8fa274db4 100644 --- a/src/sql/parts/notebook/cellViews/textCell.component.ts +++ b/src/sql/parts/notebook/cellViews/textCell.component.ts @@ -82,9 +82,7 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges { if (propName === 'activeCellId') { let changedProp = changes[propName]; this._activeCellId = changedProp.currentValue; - if (this._activeCellId) { - this.toggleEditMode(false); - } + this.toggleEditMode(false); break; } } @@ -117,7 +115,7 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges { } return content; } - + // Todo: implement layout public layout() { diff --git a/src/sql/parts/notebook/notebook.component.html b/src/sql/parts/notebook/notebook.component.html index 6f44e48122..338099d191 100644 --- a/src/sql/parts/notebook/notebook.component.html +++ b/src/sql/parts/notebook/notebook.component.html @@ -7,9 +7,9 @@