From 47befdbf61a031d42d852ebd35451bad445a6b31 Mon Sep 17 00:00:00 2001 From: lilia Date: Fri, 23 Oct 2015 17:20:24 -0700 Subject: [PATCH] Messages bubbles with errors are clickable For messages with errors, clicking anywhere inside the bubble takes you to the message detail view. // FREEBIE --- js/views/message_view.js | 5 +++-- stylesheets/_conversation.scss | 7 ++++--- stylesheets/manifest.css | 13 +++++++------ 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/js/views/message_view.js b/js/views/message_view.js index 0f90c0465616..975463946064 100644 --- a/js/views/message_view.js +++ b/js/views/message_view.js @@ -16,7 +16,8 @@ this.listenTo(this.model, 'destroy', this.remove); }, events: { - 'click .timestamp': 'select' + 'click .timestamp': 'select', + 'click .error': 'select' }, select: function() { this.$el.trigger('select', {message: this.model}); @@ -35,7 +36,7 @@ renderErrors: function() { var errors = this.model.get('errors'); if (_.size(errors) > 0) { - this.$el.addClass('error'); + this.$('.bubble').addClass('error'); if (this.model.isIncoming()) { this.$('.content').text(this.model.getDescription()).addClass('error-message'); } diff --git a/stylesheets/_conversation.scss b/stylesheets/_conversation.scss index ff272fcec33f..cea123a57acf 100644 --- a/stylesheets/_conversation.scss +++ b/stylesheets/_conversation.scss @@ -262,14 +262,15 @@ opacity: 1.0; } - .error .bubble { + .error.bubble { + cursor: pointer; background: url('/images/error_red.png') no-repeat; } - .incoming.error .bubble { + .incoming .error.bubble { padding-right: 40px; background-position: calc(100% - 12px) 9px; } - .outgoing.error .bubble { + .outgoing .error.bubble { padding-left: 40px; background-position: 12px 9px; } diff --git a/stylesheets/manifest.css b/stylesheets/manifest.css index dc739fcd427b..667c50c1b2e9 100644 --- a/stylesheets/manifest.css +++ b/stylesheets/manifest.css @@ -729,15 +729,16 @@ input.search { .message-detail .outgoing.sent .bubble, .message-list .outgoing.sent .bubble { opacity: 1.0; } - .message-detail .error .bubble, - .message-list .error .bubble { + .message-detail .error.bubble, + .message-list .error.bubble { + cursor: pointer; background: url("/images/error_red.png") no-repeat; } - .message-detail .incoming.error .bubble, - .message-list .incoming.error .bubble { + .message-detail .incoming .error.bubble, + .message-list .incoming .error.bubble { padding-right: 40px; background-position: calc(100% - 12px) 9px; } - .message-detail .outgoing.error .bubble, - .message-list .outgoing.error .bubble { + .message-detail .outgoing .error.bubble, + .message-list .outgoing .error.bubble { padding-left: 40px; background-position: 12px 9px; } .message-detail .incoming .bubble,