Show three dot icon next to message on hover

But only if it doesn't have an error.

Also: reformatted message template in legacy_templates.js to match what
is in background.html for easier diffing.
This commit is contained in:
Scott Nonnenberg 2018-04-16 18:46:36 -07:00
parent a563dc8b37
commit 30957341e4
No known key found for this signature in database
GPG Key ID: 5F82280C35134661
6 changed files with 76 additions and 21 deletions

View File

@ -291,6 +291,11 @@
<span class='status hide'></span>
<span class='timer'></span>
</div>
{{ #hoverIcon }}
<div class='hover-icon-container'>
<span class='dots-horizontal-icon'></span>
</div>
{{ /hoverIcon }}
</div>
</script>
<script type='text/x-tmpl-mustache' id='hourglass'>

View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M16,12A2,2 0 0,1 18,10A2,2 0 0,1 20,12A2,2 0 0,1 18,14A2,2 0 0,1 16,12M10,12A2,2 0 0,1 12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12M4,12A2,2 0 0,1 6,10A2,2 0 0,1 8,12A2,2 0 0,1 6,14A2,2 0 0,1 4,12Z" /></svg>

After

Width:  |  Height:  |  Size: 501 B

View File

@ -468,6 +468,9 @@
},
render() {
const contact = this.model.isIncoming() ? this.model.getContact() : null;
const errors = this.model.get('errors');
const hasErrors = errors && errors.length > 0;
this.$el.html(Mustache.render(_.result(this, 'template', ''), {
message: this.model.get('body'),
timestamp: this.model.get('sent_at'),
@ -475,6 +478,7 @@
avatar: (contact && contact.getAvatar()),
profileName: (contact && contact.getProfileName()),
innerBubbleClasses: this.isImageWithoutCaption() ? '' : 'with-tail',
hoverIcon: !hasErrors,
}, this.render_partials()));
this.timeStampView.setElement(this.$('.timestamp'));
this.timeStampView.update();

View File

@ -353,6 +353,25 @@ li.entry .error-icon-container {
&:hover .error-message { display: inline-block; }
}
li.entry .hover-icon-container {
position: absolute;
top: 0;
left: calc(100% + 5px);
height: 100%;
visibility: hidden;
.dots-horizontal-icon {
display: block;
height: 100%;
}
cursor: pointer;
}
li.entry:hover .hover-icon-container {
visibility: visible;
}
.error-icon {
display: inline-block;
@ -362,6 +381,18 @@ li.entry .error-icon-container {
@include color-svg('../images/warning.svg', red);
}
.dots-horizontal-icon {
display: inline-block;
width: $error-icon-size;
height: $error-icon-size;
position: relative;
@include color-svg('../images/dots-horizontal.svg', gray);
&:hover {
@include color-svg('../images/dots-horizontal.svg', black);
}
}
.group {
li.entry .unregistered-user-error {
display: none;
@ -667,6 +698,10 @@ span.status {
left: auto;
right: calc(100% + 5px);
}
.hover-icon-container {
left: auto;
right: calc(100% + 5px);
}
.avatar, .bubble {
float: right;

View File

@ -226,6 +226,11 @@
<span class='status hide'></span>
<span class='timer'></span>
</div>
{{ #hoverIcon }}
<div class='hover-icon-container'>
<span class='dots-horizontal-icon'></span>
</div>
{{ /hoverIcon }}
</div>
</script>
<script type='text/x-tmpl-mustache' id='hourglass'>

View File

@ -24,29 +24,34 @@ window.Whisper.View.Templates = {
</span>
`,
message: `
{{> avatar }}
<div class='bubble {{ avatar.color }}'>
<div class='sender' dir='auto'>
{{ sender }}
{{ #profileName }}
<span class='profileName'>{{ profileName }} </span>
{{ /profileName }}
</div>
<div class='tail-wrapper {{ innerBubbleClasses }}'>
<div class='inner-bubble'>
<div class='quote-wrapper'></div>
<div class='attachments'></div>
<div class='content' dir='auto'>
{{ #message }}<div class='body'>{{ message }}</div>{{ /message }}
{{> avatar }}
<div class='bubble {{ avatar.color }}'>
<div class='sender' dir='auto'>
{{ sender }}
{{ #profileName }}
<span class='profileName'>{{ profileName }} </span>
{{ /profileName }}
</div>
<div class='tail-wrapper {{ innerBubbleClasses }}'>
<div class='inner-bubble'>
<div class='quote-wrapper'></div>
<div class='attachments'></div>
<div class='content' dir='auto'>
{{ #message }}<div class='body'>{{ message }}</div>{{ /message }}
</div>
</div>
</div>
</div>
<div class='meta'>
<span class='timestamp' data-timestamp={{ timestamp }}></span>
<span class='status hide'></span>
<span class='timer'></span>
</div>
</div>
<div class='meta'>
<span class='timestamp' data-timestamp={{ timestamp }}></span>
<span class='status hide'></span>
<span class='timer'></span>
</div>
{{ #hoverIcon }}
<div class='hover-icon-container'>
<span class='dots-horizontal-icon'></span>
</div>
{{ /hoverIcon }}
</div>
`,
hourglass: `
<span class='hourglass'><span class='sand'></span></span>