mirror of
https://github.com/nextcloud/passman.git
synced 2024-12-28 02:44:14 +08:00
32 lines
689 B
JavaScript
32 lines
689 B
JavaScript
'use strict';
|
|
|
|
/**
|
|
* @ngdoc directive
|
|
* @name passmanApp.directive:passwordGen
|
|
* @description
|
|
* # passwordGen
|
|
*/
|
|
angular.module('passmanApp')
|
|
.directive('tooltip', ['$window', function ($window) {
|
|
return {
|
|
restrict: 'A',
|
|
scope: {
|
|
tooltip: '=tooltip'
|
|
},
|
|
|
|
link: function (scope, el, attr, ctrl) {
|
|
scope.$watch('tooltip', function (newVal, old) {
|
|
if (scope.tooltip) {
|
|
$(el).attr('title', scope.tooltip);
|
|
$(el).tooltip();
|
|
$(el).attr('title', scope.tooltip).tooltip('fixTitle');
|
|
$('.tooltip-inner').text(scope.tooltip); // Dirty hack
|
|
if($(el).is(':visible')){
|
|
//$(el).tooltip('show')
|
|
}
|
|
|
|
}
|
|
})
|
|
}
|
|
};
|
|
}]);
|