Fix hovercard view console error

closes #6480
This commit is contained in:
Steffen van Bergerem 2015-10-09 23:40:24 +02:00 committed by Dennis Schubert
parent 2fc7caf0bd
commit 230f6d6d62
3 changed files with 13 additions and 0 deletions

View file

@ -8,6 +8,7 @@
* Normalize new followed tags and insert them alphabetically [#6454](https://github.com/diaspora/diaspora/pull/6454)
* Add avatar fallback for notification dropdown [#6463](https://github.com/diaspora/diaspora/pull/6463)
* Improve handling of j/k hotkeys [#6462](https://github.com/diaspora/diaspora/pull/6462)
* Fix JS error caused by hovercards [6480](https://github.com/diaspora/diaspora/pull/6480)
## Features
* Show spinner on initial stream load [#6384](https://github.com/diaspora/diaspora/pull/6384)

View file

@ -147,6 +147,7 @@ app.views.Hovercard = app.views.Base.extend({
},
mouseIsOverElement: function(element, event) {
if(!element) { return false; }
var elPos = element.offset();
return event.pageX >= elPos.left &&
event.pageX <= elPos.left + element.width() &&

View file

@ -0,0 +1,11 @@
describe("app.views.Hovercard", function() {
beforeEach(function() {
this.view = new app.views.Hovercard();
});
describe("mouseIsOverElement", function() {
it("returns false if the element is undefined", function() {
expect(this.view.mouseIsOverElement(undefined, $.Event())).toBeFalsy();
});
});
});