From b0a24a757225a9541e6a1dff0dd2c0ebab0ead24 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 27 Apr 2017 13:38:56 +0200 Subject: [PATCH 1/6] Start the contacts popup Signed-off-by: Joas Schilling --- js/richObjectStringParser.js | 12 ++++++------ js/script.js | 5 +++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/js/richObjectStringParser.js b/js/richObjectStringParser.js index 9a67eead5..68b8e7352 100644 --- a/js/richObjectStringParser.js +++ b/js/richObjectStringParser.js @@ -20,8 +20,8 @@ _emailTemplate: '', - _userTemplate: '{{name}}', - _userWithAvatarTemplate: '
', + _userLocalTemplate: '
{{name}}
', + _userRemoteTemplate: '{{name}}', _unknownTemplate: '{{name}}', _unknownLinkTemplate: '{{name}}', @@ -83,11 +83,11 @@ case 'user': if (!this.userTemplate) { - var template = this._userTemplate; - if (this.avatarsEnabled && _.isUndefined(parameter.server)) { - template = this._userWithAvatarTemplate + template; + if (_.isUndefined(parameter.server)) { + this.userTemplate = Handlebars.compile(this._userLocalTemplate); + } else{ + this.userTemplate = Handlebars.compile(this._userRemoteTemplate); } - this.userTemplate = Handlebars.compile(template); } return this.userTemplate(parameter); diff --git a/js/script.js b/js/script.js index 2371e504c..18dddb528 100755 --- a/js/script.js +++ b/js/script.js @@ -264,6 +264,11 @@ $(function(){ } }); + $element.find('.avatar-name-wrapper').each(function() { + var element = $(this); + element.contactsMenu(element.data('user'), 0, element.parent()); + }); + $element.find('.activity-more-link').click(function() { var $moreElement = $(this), activityId = $moreElement.closest('.box').data('activity-id'), From 3d2955660c476620d4b99461a39cfc4981197774 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Thu, 27 Apr 2017 14:52:37 +0200 Subject: [PATCH 2/6] fix position of contactsmenu popover Signed-off-by: Georg Ehrke --- css/style.css | 5 ++++- js/script.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/css/style.css b/css/style.css index c7464a222..6a975a8be 100755 --- a/css/style.css +++ b/css/style.css @@ -10,7 +10,6 @@ margin-bottom: 5px; margin-left: 5px; text-overflow: ellipsis; - overflow: hidden; } .activitymessage { margin-left: 25px; @@ -221,3 +220,7 @@ top: 3px; margin-left: 5px; } + +.avatar-name-wrapper { + position: relative; +} diff --git a/js/script.js b/js/script.js index 18dddb528..8955df9ab 100755 --- a/js/script.js +++ b/js/script.js @@ -266,7 +266,10 @@ $(function(){ $element.find('.avatar-name-wrapper').each(function() { var element = $(this); - element.contactsMenu(element.data('user'), 0, element.parent()); + var avatar = element.find('.avatar'); + var label = element.find('strong'); + + $.merge(avatar, label).contactsMenu(element.data('user'), 0, element); }); $element.find('.activity-more-link').click(function() { From 541a668530b35fc8261c3807719a6cdd285cfb11 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 27 Apr 2017 15:06:00 +0200 Subject: [PATCH 3/6] Add the feature to the file sidebar as well Signed-off-by: Joas Schilling --- js/activitytabview.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/js/activitytabview.js b/js/activitytabview.js index 0f5b0ea65..0c6d3f2f2 100644 --- a/js/activitytabview.js +++ b/js/activitytabview.js @@ -212,6 +212,13 @@ element.avatar(element.data('user'), 21); } }); + $el.find('.avatar-name-wrapper').each(function() { + var element = $(this); + var avatar = element.find('.avatar'); + var label = element.find('strong'); + + $.merge(avatar, label).contactsMenu(element.data('user'), 0, element); + }); $el.find('.has-tooltip').tooltip({ placement: 'bottom' }); From bf4db0e17b201b7c3700f6e9a72a730663765bd2 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 27 Apr 2017 15:10:59 +0200 Subject: [PATCH 4/6] Fix caching Signed-off-by: Joas Schilling --- js/richObjectStringParser.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/js/richObjectStringParser.js b/js/richObjectStringParser.js index 68b8e7352..8c01c70b8 100644 --- a/js/richObjectStringParser.js +++ b/js/richObjectStringParser.js @@ -82,15 +82,18 @@ return this.emailTemplate(parameter); case 'user': - if (!this.userTemplate) { - if (_.isUndefined(parameter.server)) { - this.userTemplate = Handlebars.compile(this._userLocalTemplate); - } else{ - this.userTemplate = Handlebars.compile(this._userRemoteTemplate); + if (_.isUndefined(parameter.server)) { + if (!this.userLocalTemplate) { + this.userLocalTemplate = Handlebars.compile(this._userLocalTemplate); } + return this.userLocalTemplate(parameter); } - return this.userTemplate(parameter); + if (!this.userRemoteTemplate) { + this.userRemoteTemplate = Handlebars.compile(this._userRemoteTemplate); + } + + return this.userRemoteTemplate(parameter); default: if (!_.isUndefined(parameter.link)) { From a06cda41827f9c7ee48caa33f9f7e8ebd8050fb4 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 27 Apr 2017 15:24:35 +0200 Subject: [PATCH 5/6] Fix popup in message section Signed-off-by: Joas Schilling --- css/style.css | 1 - 1 file changed, 1 deletion(-) diff --git a/css/style.css b/css/style.css index 6a975a8be..36b8a3a84 100755 --- a/css/style.css +++ b/css/style.css @@ -15,7 +15,6 @@ margin-left: 25px; color:#666; text-overflow: ellipsis; - overflow: hidden; } .activity-previews { margin-left: 24px; From 6896bfd1b9167c92f623e53069ff3916c43e6360 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 27 Apr 2017 15:31:40 +0200 Subject: [PATCH 6/6] Not globally and adjust cursor Signed-off-by: Joas Schilling --- css/style.css | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/css/style.css b/css/style.css index 36b8a3a84..5028bb092 100755 --- a/css/style.css +++ b/css/style.css @@ -220,6 +220,8 @@ margin-left: 5px; } -.avatar-name-wrapper { +.activitymessage .avatar-name-wrapper, +.activitysubject .avatar-name-wrapper { position: relative; + cursor: pointer; }