Commit 14710f77 authored by Phil Hughes's avatar Phil Hughes

Shows tooltip for resolved even if user cant resolve comments

parent a678fef8
...@@ -20,11 +20,9 @@ ...@@ -20,11 +20,9 @@
}, },
computed: { computed: {
buttonText: function () { buttonText: function () {
if (!this.canResolve) return;
if (this.isResolved) { if (this.isResolved) {
return `Resolved by ${this.resolvedByName}`; return `Resolved by ${this.resolvedByName}`;
} else { } else if (this.canResolve) {
return 'Mark as resolved'; return 'Mark as resolved';
} }
}, },
...@@ -33,13 +31,13 @@ ...@@ -33,13 +31,13 @@
}, },
methods: { methods: {
updateTooltip: function () { updateTooltip: function () {
if (this.canResolve) { $(this.$els.button)
$(this.$els.button) .tooltip('hide')
.tooltip('hide') .tooltip('fixTitle');
.tooltip('fixTitle');
}
}, },
resolve: function () { resolve: function () {
if (!this.canResolve) return;
let promise; let promise;
this.loading = true; this.loading = true;
...@@ -65,11 +63,9 @@ ...@@ -65,11 +63,9 @@
} }
}, },
compiled: function () { compiled: function () {
if (this.canResolve) { $(this.$els.button).tooltip({
$(this.$els.button).tooltip({ container: 'body'
container: 'body' });
});
}
}, },
destroyed: function () { destroyed: function () {
CommentsStore.delete(this.discussionId, this.noteId); CommentsStore.delete(this.discussionId, this.noteId);
......
...@@ -411,6 +411,10 @@ ul.notes { ...@@ -411,6 +411,10 @@ ul.notes {
outline: 0; outline: 0;
vertical-align: middle; vertical-align: middle;
&.is-disabled {
cursor: default;
}
&:not(.is-disabled):hover, &:not(.is-disabled):hover,
&.is-active { &.is-active {
color: #fff; color: #fff;
......
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
class: ("is-disabled" if !can?(current_user, :resolve_note, note)), class: ("is-disabled" if !can?(current_user, :resolve_note, note)),
":class" => "{ 'is-active': isResolved }", ":class" => "{ 'is-active': isResolved }",
":aria-label" => "buttonText", ":aria-label" => "buttonText",
":disabled" => !can?(current_user, :resolve_note, note),
"@click" => "resolve", "@click" => "resolve",
":title" => "buttonText", ":title" => "buttonText",
"v-show" => "!loading", "v-show" => "!loading",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment