From af85797cae3efeb3906796f61133050b66292367 Mon Sep 17 00:00:00 2001 From: RogerHo Date: Thu, 4 Aug 2016 17:37:23 +0800 Subject: [PATCH] Fix --- dist/browser.min.js | 3 ++- dist/directive.js | 3 ++- example/index.html | 2 ++ package.json | 4 ++-- src/directive.js | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/dist/browser.min.js b/dist/browser.min.js index dcfbe0d..57635b7 100644 --- a/dist/browser.min.js +++ b/dist/browser.min.js @@ -34,7 +34,8 @@ var link = function link(scope, element, attrs) { return attrs.$observe(prop, function (data) { config[prop] = data; if (tooltipInstance) { - tooltipInstance.setOptions(getOpt()); + tooltipInstance.destroy(); + tooltipInstance = new Tooltip(getOpt()); } }); }); diff --git a/dist/directive.js b/dist/directive.js index ad66feb..ccb2296 100644 --- a/dist/directive.js +++ b/dist/directive.js @@ -33,7 +33,8 @@ var link = function link(scope, element, attrs) { return attrs.$observe(prop, function (data) { config[prop] = data; if (tooltipInstance) { - tooltipInstance.setOptions(getOpt()); + tooltipInstance.destroy(); + tooltipInstance = new Tooltip(getOpt()); } }); }); diff --git a/example/index.html b/example/index.html index 0f88a1b..4082b99 100644 --- a/example/index.html +++ b/example/index.html @@ -27,6 +27,8 @@ $scope.count = 0; $interval(function() { $scope.count++; + }, 1000); + $interval(function() { $scope.enabled = !$scope.enabled; }, 5000); }) diff --git a/package.json b/package.json index 9a167ce..5adc7d5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ng-tether-tooltip", - "version": "1.0.5", + "version": "1.0.6", "description": "", "main": "dist/module.js", "scripts": { @@ -19,7 +19,7 @@ "angular" ], "dependencies": { - "tether-tooltip": "^1.2.0" + "tether-tooltip": "1.2.0" }, "devDependencies": { "angular": "^1.5.3", diff --git a/src/directive.js b/src/directive.js index ff90c83..0df486c 100644 --- a/src/directive.js +++ b/src/directive.js @@ -26,7 +26,8 @@ const link = (scope, element, attrs) => { angular.forEach(PROPS, prop => attrs.$observe(prop, data => { config[prop] = data; if (tooltipInstance) { - tooltipInstance.setOptions(getOpt()); + tooltipInstance.destroy(); + tooltipInstance = new Tooltip(getOpt()); } }));