Use Bootstrap tooltips instead of plain title attributes

By using data-original-title the tooltips live update without reapplying the
js code, such as .tooltip('fixTitle') each time the content changes. This
method also works well with angular expressions:

    data-original-title="{{'Download Rate' | translate}}"

This example provides a bootstrap tooltip saying 'Download Rate' that changes
automatically when the language is updated.
This commit is contained in:
norgeous
2016-03-16 14:55:29 +00:00
committed by Jakob Borg
parent f66c1c3c9c
commit 78120bd989
4 changed files with 28 additions and 4 deletions

View File

@@ -0,0 +1,11 @@
angular.module('syncthing.core')
.directive('tooltip', function () {
return {
restrict: 'A',
link: function (scope, element, attributes) {
$(element).tooltip({
html: 'true'
});
}
};
});