New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

angularjs-tooltips

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angularjs-tooltips - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

bower.json
{
"name": "angular-tooltips",
"description": "Tooltip Directive For AngularJS",
"version": "1.0.1",
"version": "1.0.2",
"homepage": "https://github.com/intellipharm/angular-tooltips",

@@ -6,0 +6,0 @@ "repository": {

(function() {
'use strict';
var directive = function ($timeout) {
var directive = function ($timeout, $compile) {
return {

@@ -33,2 +33,4 @@ restrict: 'A',

$compile($scope.tooltipElement.contents())($scope);
var css = $scope.calculatePosition($scope.tooltipElement, $scope.getDirection());

@@ -45,3 +47,3 @@ $scope.tooltipElement.css(css);

$scope.$watch('title', function(newTitle) {
if($scope.tooltipElement) {
if ($scope.tooltipElement) {
$scope.updateTooltip(newTitle);

@@ -161,3 +163,3 @@ }

directive.$inject = ['$timeout'];
directive.$inject = ['$timeout', '$compile'];

@@ -164,0 +166,0 @@ angular

@@ -1,1 +0,1 @@

!function(){"use strict";var t=function(t){return{restrict:"A",scope:{title:"@"},link:function(e,o,i){e.createTooltip=function(t){if(i.title||i.tooltip){var o=e.getDirection();e.tooltipElement=angular.element("<div>").addClass("angular-tooltip angular-tooltip-"+o),angular.element(document).find("body").append(e.tooltipElement),e.updateTooltip(i.title||i.tooltip),e.tooltipElement.addClass("angular-tooltip-fade-in")}},e.updateTooltip=function(i){e.tooltipElement.html(i);var l=e.calculatePosition(e.tooltipElement,e.getDirection());e.tooltipElement.css(l),t(function(){o.removeAttr("ng-attr-title"),o.removeAttr("title")})},e.$watch("title",function(t){e.tooltipElement&&e.updateTooltip(t)}),e.removeTooltip=function(){var t=angular.element(document.querySelectorAll(".angular-tooltip"));t.remove()},e.getDirection=function(){return o.attr("tooltip-direction")||o.attr("title-direction")||"top"},e.calculatePosition=function(t,e){var i=t[0].getBoundingClientRect(),l=o[0].getBoundingClientRect(),p=window.scrollX||document.documentElement.scrollLeft,n=window.scrollY||document.documentElement.scrollTop,r=12;switch(e){case"top":case"top-center":case"top-middle":return{left:l.left+l.width/2-i.width/2+p+"px",top:l.top-i.height-r/2+n+"px"};case"top-right":return{left:l.left+l.width-r+p+"px",top:l.top-i.height-r/2+n+"px"};case"right-top":return{left:l.left+l.width+r/2+p+"px",top:l.top-i.height+r+n+"px"};case"right":case"right-center":case"right-middle":return{left:l.left+l.width+r/2+p+"px",top:l.top+l.height/2-i.height/2+n+"px"};case"right-bottom":return{left:l.left+l.width+r/2+p+"px",top:l.top+l.height-r+n+"px"};case"bottom-right":return{left:l.left+l.width-r+p+"px",top:l.top+l.height+r/2+n+"px"};case"bottom":case"bottom-center":case"bottom-middle":return{left:l.left+l.width/2-i.width/2+p+"px",top:l.top+l.height+r/2+n+"px"};case"bottom-left":return{left:l.left-i.width+r+p+"px",top:l.top+l.height+r/2+n+"px"};case"left-bottom":return{left:l.left-i.width-r/2+p+"px",top:l.top+l.height-r+n+"px"};case"left":case"left-center":case"left-middle":return{left:l.left-i.width-r/2+p+"px",top:l.top+l.height/2-i.height/2+n+"px"};case"left-top":return{left:l.left-i.width-r/2+p+"px",top:l.top-i.height+r+n+"px"};case"top-left":return{left:l.left-i.width+r+p+"px",top:l.top-i.height-r/2+n+"px"}}},i.title||i.tooltip?(o.on("mouseover",e.createTooltip),o.on("mouseout",e.removeTooltip)):(o.off("mouseover",e.createTooltip),o.off("mouseout",e.removeTooltip)),o.on("destroy",e.removeTooltip),e.$on("$destroy",e.removeTooltip)}}};t.$inject=["$timeout"],angular.module("tooltips",[]).directive("title",t).directive("tooltip",t)}();
!function(){"use strict";var t=function(t,e){return{restrict:"A",scope:{title:"@"},link:function(o,i,l){o.createTooltip=function(t){if(l.title||l.tooltip){var e=o.getDirection();o.tooltipElement=angular.element("<div>").addClass("angular-tooltip angular-tooltip-"+e),angular.element(document).find("body").append(o.tooltipElement),o.updateTooltip(l.title||l.tooltip),o.tooltipElement.addClass("angular-tooltip-fade-in")}},o.updateTooltip=function(l){o.tooltipElement.html(l),e(o.tooltipElement.contents())(o);var p=o.calculatePosition(o.tooltipElement,o.getDirection());o.tooltipElement.css(p),t(function(){i.removeAttr("ng-attr-title"),i.removeAttr("title")})},o.$watch("title",function(t){o.tooltipElement&&o.updateTooltip(t)}),o.removeTooltip=function(){var t=angular.element(document.querySelectorAll(".angular-tooltip"));t.remove()},o.getDirection=function(){return i.attr("tooltip-direction")||i.attr("title-direction")||"top"},o.calculatePosition=function(t,e){var o=t[0].getBoundingClientRect(),l=i[0].getBoundingClientRect(),p=window.scrollX||document.documentElement.scrollLeft,n=window.scrollY||document.documentElement.scrollTop,r=12;switch(e){case"top":case"top-center":case"top-middle":return{left:l.left+l.width/2-o.width/2+p+"px",top:l.top-o.height-r/2+n+"px"};case"top-right":return{left:l.left+l.width-r+p+"px",top:l.top-o.height-r/2+n+"px"};case"right-top":return{left:l.left+l.width+r/2+p+"px",top:l.top-o.height+r+n+"px"};case"right":case"right-center":case"right-middle":return{left:l.left+l.width+r/2+p+"px",top:l.top+l.height/2-o.height/2+n+"px"};case"right-bottom":return{left:l.left+l.width+r/2+p+"px",top:l.top+l.height-r+n+"px"};case"bottom-right":return{left:l.left+l.width-r+p+"px",top:l.top+l.height+r/2+n+"px"};case"bottom":case"bottom-center":case"bottom-middle":return{left:l.left+l.width/2-o.width/2+p+"px",top:l.top+l.height+r/2+n+"px"};case"bottom-left":return{left:l.left-o.width+r+p+"px",top:l.top+l.height+r/2+n+"px"};case"left-bottom":return{left:l.left-o.width-r/2+p+"px",top:l.top+l.height-r+n+"px"};case"left":case"left-center":case"left-middle":return{left:l.left-o.width-r/2+p+"px",top:l.top+l.height/2-o.height/2+n+"px"};case"left-top":return{left:l.left-o.width-r/2+p+"px",top:l.top-o.height+r+n+"px"};case"top-left":return{left:l.left-o.width+r+p+"px",top:l.top-o.height-r/2+n+"px"}}},l.title||l.tooltip?(i.on("mouseover",o.createTooltip),i.on("mouseout",o.removeTooltip)):(i.off("mouseover",o.createTooltip),i.off("mouseout",o.removeTooltip)),i.on("destroy",o.removeTooltip),o.$on("$destroy",o.removeTooltip)}}};t.$inject=["$timeout","$compile"],angular.module("tooltips",[]).directive("title",t).directive("tooltip",t)}();
angular.module('app', ['tooltips']).controller('AppCtrl', function($scope) {
$scope.tooltip = '<strong>Bold text</strong><br>And an icon<br><i class="fa fa-star"><i>';
$scope.compile = 'asdf';
setTimeout(function() {
$scope.compile = 'qwerty';
}, 5000);
});
{
"name": "angularjs-tooltips",
"version": "1.0.1",
"version": "1.0.2",
"license": "MIT",

@@ -25,3 +25,3 @@ "main": "dist/angular-tooltips.js",

"gulp-rename": "^1.2.2",
"gulp-sass": "^2.0.0",
"gulp-sass": "^3.0.0",
"gulp-scss-lint": "^0.4.0",

@@ -28,0 +28,0 @@ "gulp-uglify": "^2.0.0",

(function() {
'use strict';
var directive = function ($timeout) {
var directive = function ($timeout, $compile) {
return {

@@ -33,2 +33,4 @@ restrict: 'A',

$compile($scope.tooltipElement.contents())($scope);
var css = $scope.calculatePosition($scope.tooltipElement, $scope.getDirection());

@@ -45,3 +47,3 @@ $scope.tooltipElement.css(css);

$scope.$watch('title', function(newTitle) {
if($scope.tooltipElement) {
if ($scope.tooltipElement) {
$scope.updateTooltip(newTitle);

@@ -161,3 +163,3 @@ }

directive.$inject = ['$timeout'];
directive.$inject = ['$timeout', '$compile'];

@@ -164,0 +166,0 @@ angular

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc