ChangeScreen2: Fix click inside of messages
Clicking within a message body should not collapse the message. It
should have only the default browser behavior.
This is annoyingly obvious if a change message contains a hyperlink
and you click the link. The message collapses but the link opens in a
new tab. If the message had another link you also wish to follow, it
is necessary to first re-expand the message.
Move the click listener onto a new <div> that contains only the first
line (aka the header line), which is the natural click target.
Change-Id: Ic3398447df033aa69369c785166ba841f168a83d
(cherry picked from commit cd2fc945ae)
This commit is contained in:
committed by
David Pursehouse
parent
7aeed26213
commit
b7368e94e0
@@ -41,6 +41,7 @@ class Message extends Composite {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@UiField Style style;
|
@UiField Style style;
|
||||||
|
@UiField HTMLPanel header;
|
||||||
@UiField Element name;
|
@UiField Element name;
|
||||||
@UiField Element summary;
|
@UiField Element summary;
|
||||||
@UiField Element date;
|
@UiField Element date;
|
||||||
@@ -58,7 +59,7 @@ class Message extends Composite {
|
|||||||
}
|
}
|
||||||
|
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
addDomHandler(new ClickHandler() {
|
header.addDomHandler(new ClickHandler() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(ClickEvent event) {
|
public void onClick(ClickEvent event) {
|
||||||
setOpen(!isOpen());
|
setOpen(!isOpen());
|
||||||
|
|||||||
@@ -85,9 +85,11 @@ limitations under the License.
|
|||||||
addStyleNames='{style.closed}'>
|
addStyleNames='{style.closed}'>
|
||||||
<c:AvatarImage ui:field='avatar' styleName='{style.avatar}'/>
|
<c:AvatarImage ui:field='avatar' styleName='{style.avatar}'/>
|
||||||
<div class='{style.contents}'>
|
<div class='{style.contents}'>
|
||||||
|
<g:HTMLPanel ui:field='header'>
|
||||||
<div class='{style.name}' ui:field='name'/>
|
<div class='{style.name}' ui:field='name'/>
|
||||||
<div ui:field='summary' class='{style.summary}'/>
|
<div ui:field='summary' class='{style.summary}'/>
|
||||||
<div class='{style.date}' ui:field='date'/>
|
<div class='{style.date}' ui:field='date'/>
|
||||||
|
</g:HTMLPanel>
|
||||||
<div ui:field='message'
|
<div ui:field='message'
|
||||||
aria-hidden='true'
|
aria-hidden='true'
|
||||||
style='display: NONE'/>
|
style='display: NONE'/>
|
||||||
|
|||||||
Reference in New Issue
Block a user