mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Fix notebook selection issues including from placeholder (#3836)
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
<div style="overflow: hidden; width: 100%; height: 100%; display: flex; flex-flow: column">
|
<div style="overflow: hidden; width: 100%; height: 100%; display: flex; flex-flow: column">
|
||||||
<div class="placeholder-cell-component" style="flex: 0 0 auto;">
|
<div class="placeholder-cell-component" style="flex: 0 0 auto;">
|
||||||
<div class="placeholder-cell-component text">
|
<div class="placeholder-cell-component text">
|
||||||
<p>{{clickOn}} <a href="#" (click)="addCell('code')">{{plusCode}}</a> {{or}} <a href="#" (click)="addCell('markdown')">{{plusText}}</a> {{toAddCell}}</p>
|
<p>{{clickOn}} <a href="#" (click)="addCell('code', $event)">{{plusCode}}</a> {{or}} <a href="#" (click)="addCell('markdown', $event)">{{plusText}}</a> {{toAddCell}}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -68,7 +68,10 @@ export class PlaceholderCellComponent extends CellView implements OnInit, OnChan
|
|||||||
return localize('toAddCell', 'to add a code or text cell');
|
return localize('toAddCell', 'to add a code or text cell');
|
||||||
}
|
}
|
||||||
|
|
||||||
public addCell(cellType: string): void {
|
public addCell(cellType: string, event?: Event): void {
|
||||||
|
if (event) {
|
||||||
|
event.stopPropagation();
|
||||||
|
}
|
||||||
let type: CellType = <CellType>cellType;
|
let type: CellType = <CellType>cellType;
|
||||||
if (!type) {
|
if (!type) {
|
||||||
type = 'code';
|
type = 'code';
|
||||||
|
|||||||
@@ -173,14 +173,14 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
|
|||||||
public unselectActiveCell() {
|
public unselectActiveCell() {
|
||||||
if (this.model && this.model.activeCell) {
|
if (this.model && this.model.activeCell) {
|
||||||
this.model.activeCell.active = false;
|
this.model.activeCell.active = false;
|
||||||
|
this.model.activeCell = undefined;
|
||||||
}
|
}
|
||||||
this._changeRef.detectChanges();
|
this._changeRef.detectChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add cell based on cell type
|
// Add cell based on cell type
|
||||||
public addCell(cellType: CellType) {
|
public addCell(cellType: CellType) {
|
||||||
let newCell = this._model.addCell(cellType);
|
this._model.addCell(cellType);
|
||||||
this.selectCell(newCell);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Updates Notebook model's trust details
|
// Updates Notebook model's trust details
|
||||||
|
|||||||
Reference in New Issue
Block a user