提交 0129edae 编写于 作者: R Rachel Macfarlane

Expand comment reply area on focus

上级 ffba25fc
......@@ -473,17 +473,20 @@ export class ReviewZoneWidget extends ZoneWidget {
this._headingLabel.setAttribute('aria-label', label);
}
private expandReplyArea() {
if (!dom.hasClass(this._commentForm, 'expand')) {
dom.addClass(this._commentForm, 'expand');
this._commentEditor.focus();
}
}
private createReplyButton() {
this._reviewThreadReplyButton = <HTMLButtonElement>dom.append(this._commentForm, dom.$('button.review-thread-reply-button'));
this._reviewThreadReplyButton.title = nls.localize('reply', "Reply...");
this._reviewThreadReplyButton.textContent = nls.localize('reply', "Reply...");
// bind click/escape actions for reviewThreadReplyButton and textArea
this._reviewThreadReplyButton.onclick = () => {
if (!dom.hasClass(this._commentForm, 'expand')) {
dom.addClass(this._commentForm, 'expand');
this._commentEditor.focus();
}
};
this._localToDispose.push(dom.addDisposableListener(this._reviewThreadReplyButton, 'click', _ => this.expandReplyArea()));
this._localToDispose.push(dom.addDisposableListener(this._reviewThreadReplyButton, 'focus', _ => this.expandReplyArea()));
this._commentEditor.onDidBlurEditorWidget(() => {
if (this._commentEditor.getModel().getValueLength() === 0 && dom.hasClass(this._commentForm, 'expand')) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册