fix zero height output height.
This commit is contained in:
parent
7bc2019b8d
commit
cd8bf7ba53
3 changed files with 14 additions and 0 deletions
|
@ -118,6 +118,7 @@ export interface ICellOutputViewModel {
|
|||
resolveMimeTypes(textModel: NotebookTextModel, kernelProvides: readonly string[] | undefined): [readonly IOrderedMimeType[], number];
|
||||
pickedMimeType: number;
|
||||
supportAppend(): boolean;
|
||||
hasMultiMimeType(): boolean;
|
||||
toRawJSON(): any;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,6 +33,15 @@ export class CellOutputViewModel extends Disposable implements ICellOutputViewMo
|
|||
super();
|
||||
}
|
||||
|
||||
hasMultiMimeType() {
|
||||
if (this._outputRawData.outputs.length < 2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const firstMimeType = this._outputRawData.outputs[0].mime;
|
||||
return this._outputRawData.outputs.some(output => output.mime !== firstMimeType);
|
||||
}
|
||||
|
||||
supportAppend() {
|
||||
// if there is any mime type that's not mergeable then the whole output is not mergeable.
|
||||
return this._outputRawData.outputs.every(op => mimeTypeIsMergeable(op.mime));
|
||||
|
|
|
@ -343,6 +343,10 @@ export class CodeCellViewModel extends BaseCellViewModel implements ICellViewMod
|
|||
}
|
||||
|
||||
this._ensureOutputsTop();
|
||||
if (height < 28 && this._outputViewModels[index].hasMultiMimeType()) {
|
||||
height = 28;
|
||||
}
|
||||
|
||||
this._outputCollection[index] = height;
|
||||
if (this._outputsTop!.changeValue(index, height)) {
|
||||
this.layoutChange({ outputHeight: true }, source);
|
||||
|
|
Loading…
Reference in a new issue