UNPKG

landers.angular

Version:

landers.angular

33 lines (32 loc) 1.22 kB
;angular.module('Landers.angular') .directive('protip', [function(){ var is_protip = false; return { restrict : 'C', link : function($scope, $ele, $attrs){ var self = arguments.callee; if ( !$ele.attr('data-pt-size') ) { $ele.attr('data-pt-size', 'small'); } if ( !$ele.attr('data-pt-scheme') ) { $ele.attr('data-pt-scheme', 'black'); } if ($.protip && $ele.attr('data-pt-title')) { $.protip(); $ele.on('protipshow', function(itemInstance){ var $me = $(itemInstance.target); var t = $me.data('ptShow'); if (t !== undefined && t !== true) { setTimeout(function(){ $me.protipHide(); }, 5); } }); } else { setTimeout(function(){ self($scope, $ele, $attrs); }, 500); } } }; }]);