提交 24465045 编写于 作者: R rebornix

Fix microsoft/vscode-pull-request-github#127. Close new comment widget when escape if it's empty

上级 3ffdfae5
...@@ -354,9 +354,14 @@ export class ReviewZoneWidget extends ZoneWidget { ...@@ -354,9 +354,14 @@ export class ReviewZoneWidget extends ZoneWidget {
this._localToDispose.push(this._commentEditor.onKeyDown((ev: IKeyboardEvent) => { this._localToDispose.push(this._commentEditor.onKeyDown((ev: IKeyboardEvent) => {
const hasExistingComments = this._commentThread.comments.length > 0; const hasExistingComments = this._commentThread.comments.length > 0;
if (this._commentEditor.getModel().getValueLength() === 0 && ev.keyCode === KeyCode.Escape && hasExistingComments) {
if (dom.hasClass(this._commentForm, 'expand')) { if (this._commentEditor.getModel().getValueLength() === 0 && ev.keyCode === KeyCode.Escape) {
dom.removeClass(this._commentForm, 'expand'); if (hasExistingComments) {
if (dom.hasClass(this._commentForm, 'expand')) {
dom.removeClass(this._commentForm, 'expand');
}
} else {
this.dispose();
} }
} }
})); }));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册