Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerhokp committed Aug 4, 2016
1 parent 36572b4 commit af85797
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion dist/browser.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
});
});
Expand Down
3 changes: 2 additions & 1 deletion dist/directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
});
});
Expand Down
2 changes: 2 additions & 0 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
$scope.count = 0;
$interval(function() {
$scope.count++;
}, 1000);
$interval(function() {
$scope.enabled = !$scope.enabled;
}, 5000);
})
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ng-tether-tooltip",
"version": "1.0.5",
"version": "1.0.6",
"description": "",
"main": "dist/module.js",
"scripts": {
Expand All @@ -19,7 +19,7 @@
"angular"
],
"dependencies": {
"tether-tooltip": "^1.2.0"
"tether-tooltip": "1.2.0"
},
"devDependencies": {
"angular": "^1.5.3",
Expand Down
3 changes: 2 additions & 1 deletion src/directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}));

Expand Down

0 comments on commit af85797

Please sign in to comment.