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:
11
gui/default/syncthing/core/tooltipDirective.js
Normal file
11
gui/default/syncthing/core/tooltipDirective.js
Normal file
@@ -0,0 +1,11 @@
|
||||
angular.module('syncthing.core')
|
||||
.directive('tooltip', function () {
|
||||
return {
|
||||
restrict: 'A',
|
||||
link: function (scope, element, attributes) {
|
||||
$(element).tooltip({
|
||||
html: 'true'
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user