Merge pull request #358 from nextcloud/add-tooltips

Add tooltips and support for contacts menu at avatars
This commit is contained in:
Julius Härtl
2017-12-17 17:44:35 +01:00
committed by GitHub
7 changed files with 31 additions and 18 deletions

View File

@@ -74,4 +74,9 @@ app.run(function ($document, $rootScope, $transitions, BoardService) {
}
}
});
// Select all elements with data-toggle="tooltips" in the document
$('body').tooltip({
selector: '[data-toggle="tooltip"]'
});
});

View File

@@ -26,11 +26,12 @@ app.directive('avatar', function() {
restrict: 'A',
scope: true,
link: function(scope, element, attr){
attr.$observe('displayname', function(value){
if(value!==undefined) {
$(element).avatar(value, 32);
}
});
var value = attr.user;
$(element).wrap('<div class="avatardiv-container"></div>');
if(attr.contactsmenu && oc_current_user !== value) {
$(element).contactsMenu(value, 0, $(element).parent());
}
$(element).avatar(value, 32, false, false, false, attr.displayname);
}
};
});