diff --git a/css/style.scss b/css/style.scss index b0b45be4e..4d663dae3 100644 --- a/css/style.scss +++ b/css/style.scss @@ -996,6 +996,10 @@ input.input-inline { padding: 16px; opacity: 0.5; } + + &.has-contactsmenu img { + cursor: pointer; + } } .avatardiv-container { diff --git a/js/directive/avatar.js b/js/directive/avatar.js index 95f4a2489..c93165985 100644 --- a/js/directive/avatar.js +++ b/js/directive/avatar.js @@ -23,15 +23,27 @@ app.directive('avatar', function() { 'use strict'; return { - restrict: 'A', - scope: true, + restrict: 'AEC', + transclude: true, + replace: true, + template: '
', + scope: { attr: '=' }, link: function(scope, element, attr){ + scope.uid = attr.displayname; + scope.displayname = attr.displayname; var value = attr.user; - $(element).wrap('
'); - if(attr.contactsmenu && oc_current_user !== value) { - $(element).contactsMenu(value, 0, $(element).parent()); + var avatardiv = $(element).find('.avatardiv'); + if(typeof attr.contactsmenu !== 'undefined' && attr.contactsmenu !== 'false' && oc_current_user !== value) { + avatardiv.contactsMenu(value, 0, $(element)); + avatardiv.addClass('has-contactsmenu'); } - $(element).avatar(value, 32, false, false, false, attr.displayname); + if(typeof attr.tooltip !== 'undefined' && attr.tooltip !== 'false') { + $(element).tooltip({ + title: scope.displayname, + placement: 'top' + }); + } + avatardiv.avatar(value, 32, false, false, false, attr.displayname); }, controller: function () {} }; diff --git a/js/directive/contactsmenudelete.js b/js/directive/contactsmenudelete.js index e9c638545..8fdbac5ef 100644 --- a/js/directive/contactsmenudelete.js +++ b/js/directive/contactsmenudelete.js @@ -25,15 +25,14 @@ app.directive('contactsmenudelete', function() { return { restrict: 'A', priority: 1, - scope: true, link: function(scope, element, attr){ var user = attr.user; var menu = $(element).parent().find('.contactsmenu-popover'); - var menuentry = $('
  • ' + t('deck', 'Remove user from card') + '
  • '); - menuentry.on('click', function () { + var menuEntry = $('
  • ' + t('deck', 'Remove user from card') + '
  • '); + menuEntry.on('click', function () { scope.removeAssignedUser(user); }); - $(menu).append(menuentry); + $(menu).append(menuEntry); } }; }); \ No newline at end of file diff --git a/templates/part.board.mainView.php b/templates/part.board.mainView.php index 823527d11..7fa82c0f4 100644 --- a/templates/part.board.mainView.php +++ b/templates/part.board.mainView.php @@ -82,7 +82,7 @@
    -
    +
    diff --git a/templates/part.boardlist.php b/templates/part.boardlist.php index 3047d0c36..a8a80a6b0 100644 --- a/templates/part.boardlist.php +++ b/templates/part.boardlist.php @@ -41,8 +41,8 @@
    -
    -
    + +
    diff --git a/templates/part.card.php b/templates/part.card.php index 19c085281..7e1633175 100644 --- a/templates/part.card.php +++ b/templates/part.card.php @@ -67,8 +67,7 @@
    -
    +