Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
bower_components
node_modules
.tmp
.DS_Store
1 change: 0 additions & 1 deletion examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
}
</style>

<script src="../bower_components/jquery/jquery.js"></script>
<script src="../bower_components/angular/angular.js"></script>
<script src="../bower_components/angular-animate/angular-animate.js"></script>
<script src="../bower_components/tether/tether.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = function(config) {

// list of files / patterns to load in the browser
files: [
'bower_components/jquery/jquery.js',
'bower_components/jquery/dist/jquery.js',
'bower_components/angular/angular.js',
'bower_components/tether/tether.js',

Expand Down Expand Up @@ -61,7 +61,7 @@ module.exports = function(config) {
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
browsers: ['Firefox'],
browsers: ['PhantomJS'],


// Continuous Integration mode
Expand Down
17 changes: 8 additions & 9 deletions src/angular-tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
options = extend({ templateUrl: defaultTemplateUrl }, options);
options.tether = extend({}, defaultTetherOptions, options.tether || {});

var template = options.template || ( $templateCache.get(options.templateUrl) ? $templateCache.get(options.templateUrl)[1] : undefined ),
var template = options.template || ( $templateCache.get(options.templateUrl) ? $templateCache.get(options.templateUrl) : undefined ),
scope = options.scope || $rootScope.$new(),
target = options.target,
tether, elem;
Expand All @@ -42,7 +42,7 @@
function attachTether() {
tether = new Tether(extend({
element: elem,
target: target
target: target[0]
}, options.tether));
}

Expand All @@ -53,8 +53,6 @@
if (tether) {
tether.destroy();
tether = undefined;
elem.remove();
angular.element(elem).scope().$destroy();
}
}

Expand All @@ -78,7 +76,7 @@
*/
function close() {
delete result.elem;
$animate.leave(elem);
$animate.leave(angular.element(elem));
detachTether();
}

Expand Down Expand Up @@ -119,10 +117,11 @@
/**
* Toggle the tooltip.
*/
elem.hover(function() {
scope.$apply(tooltip.open);
}, function() {
scope.$apply(tooltip.close);
elem.on('mouseover', function() {
scope.$apply(tooltip.open());
});
elem.on('mouseout', function() {
scope.$apply(tooltip.close());
});
}
};
Expand Down