SideBySide2: Only open/close comment boxes if clicked on header
Instead of adding a click handler on the whole box, add it only on the header. This restores the old behavior. The current version is a bit annoying when trying to select from a comment. Change-Id: I37580f5d9f9e266d4867bbe383cba1b65d1d4c1e
This commit is contained in:
@@ -44,6 +44,7 @@ import com.google.gwt.user.client.ui.Button;
|
||||
import com.google.gwt.user.client.ui.HTML;
|
||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||
import com.google.gwt.user.client.ui.UIObject;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.google.gwtexpui.globalkey.client.NpTextArea;
|
||||
import com.google.gwtexpui.safehtml.client.SafeHtmlBuilder;
|
||||
|
||||
@@ -65,6 +66,7 @@ class DraftBox extends CommentBox {
|
||||
private PublishedBox replyToBox;
|
||||
private Timer expandTimer;
|
||||
|
||||
@UiField Widget header;
|
||||
@UiField Element summary;
|
||||
@UiField Element date;
|
||||
|
||||
@@ -99,7 +101,7 @@ class DraftBox extends CommentBox {
|
||||
};
|
||||
set(info);
|
||||
|
||||
addDomHandler(new ClickHandler() {
|
||||
header.addDomHandler(new ClickHandler() {
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
if (!isEdit()) {
|
||||
|
||||
@@ -42,11 +42,11 @@ limitations under the License.
|
||||
|
||||
<g:HTMLPanel styleName='{res.style.commentBox}'>
|
||||
<div class='{res.style.contents}'>
|
||||
<div class='{res.style.header}'>
|
||||
<g:HTMLPanel ui:field='header' styleName='{res.style.header}'>
|
||||
<div class='{style.draft}'>Draft</div>
|
||||
<div ui:field='summary' class='{res.style.summary}'/>
|
||||
<div ui:field='date' class='{res.style.date}'/>
|
||||
</div>
|
||||
</g:HTMLPanel>
|
||||
<div ui:field='p_view' aria-hidden='true' style='display: NONE'>
|
||||
<g:HTML ui:field='message' styleName=''/>
|
||||
<div style='position: relative'>
|
||||
|
||||
@@ -36,6 +36,7 @@ import com.google.gwt.uibinder.client.UiHandler;
|
||||
import com.google.gwt.user.client.ui.Button;
|
||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||
import com.google.gwt.user.client.ui.UIObject;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.google.gwtexpui.safehtml.client.SafeHtmlBuilder;
|
||||
|
||||
/** An HtmlPanel for displaying a published comment */
|
||||
@@ -53,6 +54,7 @@ class PublishedBox extends CommentBox {
|
||||
private DraftBox replyBox;
|
||||
|
||||
@UiField Style style;
|
||||
@UiField Widget header;
|
||||
@UiField Element name;
|
||||
@UiField Element summary;
|
||||
@UiField Element date;
|
||||
@@ -81,7 +83,7 @@ class PublishedBox extends CommentBox {
|
||||
}
|
||||
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
addDomHandler(new ClickHandler() {
|
||||
header.addDomHandler(new ClickHandler() {
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
setOpen(!isOpen());
|
||||
|
||||
@@ -48,11 +48,11 @@ limitations under the License.
|
||||
addStyleNames='{style.closed}'>
|
||||
<c:AvatarImage ui:field='avatar' styleName='{style.avatar}'/>
|
||||
<div class='{res.style.contents}'>
|
||||
<div class='{res.style.header}'>
|
||||
<g:HTMLPanel ui:field='header' styleName='{res.style.header}'>
|
||||
<div ui:field='name' class='{style.name}'/>
|
||||
<div ui:field='summary' class='{res.style.summary}'/>
|
||||
<div ui:field='date' class='{res.style.date}'/>
|
||||
</div>
|
||||
</g:HTMLPanel>
|
||||
<div ui:field='message' aria-hidden='true' style='display: NONE'/>
|
||||
<div ui:field='buttons' aria-hidden='true' style='display: NONE'>
|
||||
<g:Button ui:field='reply' styleName=''
|
||||
|
||||
Reference in New Issue
Block a user