mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-25 09:35:37 -05:00
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
This commit is contained in:
@@ -140,7 +140,10 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
|
||||
toolbarEl.style.borderBottomColor = theme.getColor(themeColors.SIDE_BAR_BACKGROUND, true).toString();
|
||||
}
|
||||
|
||||
public selectCell(cell: ICellModel) {
|
||||
public selectCell(cell: ICellModel, event?: Event) {
|
||||
if (event) {
|
||||
event.stopPropagation();
|
||||
}
|
||||
if (cell !== this._activeCell) {
|
||||
if (this._activeCell) {
|
||||
this._activeCell.active = false;
|
||||
@@ -153,6 +156,16 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
|
||||
}
|
||||
}
|
||||
|
||||
public unselectActiveCell() {
|
||||
if (this._activeCell) {
|
||||
this._activeCell.active = false;
|
||||
}
|
||||
this._activeCell = null;
|
||||
this._model.activeCell = null;
|
||||
this._activeCellId = null;
|
||||
this._changeRef.detectChanges();
|
||||
}
|
||||
|
||||
// Add cell based on cell type
|
||||
public addCell(cellType: CellType)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user