Skip to content

Commit

Permalink
Enable editor when window size increased
Browse files Browse the repository at this point in the history
  • Loading branch information
minottic committed Apr 4, 2024
1 parent ebb7594 commit c39329f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -615,9 +615,11 @@ describe('LogbookItemComponent', () => {
}};
component.editorRef = {nativeElement: {offsetHeight: t.input[1]}};
const updateViewHeightsSpy = spyOn(component, 'updateViewHeights').and.callFake(() => true);
const isMobileSpy = spyOn(component, 'isMobile').and.callThrough();
if (i === 3) window.innerWidth = 10;
component.onResized();
expect(updateViewHeightsSpy).toHaveBeenCalledTimes(t.output);
expect(isMobileSpy).toHaveBeenCalledTimes(1);
expect(component.mobile).toEqual(i === 3);
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -685,10 +685,10 @@ export class LogbookItemComponent implements OnInit {
onResized() {
const _heightRef = this.snippetContainerRef.nativeElement.parentElement.parentElement.parentElement.parentElement.offsetHeight;
const _editorHeight = this.editorRef?.nativeElement?.offsetHeight;
this.isMobile();
if (this._snippetHeightRef != _heightRef || this._editorHeightRef != _editorHeight) {
this._snippetHeightRef = _heightRef;
this._editorHeightRef = _editorHeight;
this.isMobile();
this.updateViewHeights();
}
}
Expand Down

0 comments on commit c39329f

Please sign in to comment.