Skip to content
Extraits de code Groupes Projets
Valider 35fe6bda rédigé par Selman Ercan's avatar Selman Ercan
Parcourir les fichiers

Issue #5631. Made top and left coordinates of hovercards match those of their parents.

Added line to changelog for bug fix of issue #5631.

Processing the 'mouseleave' event only if we've left both the parent and the hovercard.

Fixed indentation.

Replaced issue id with pull request id and fixed indentation.
parent dd45b79a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -138,6 +138,7 @@ diaspora.yml file**. The existing settings from 0.4.x and before will not work a ...@@ -138,6 +138,7 @@ diaspora.yml file**. The existing settings from 0.4.x and before will not work a
* Disable email notifications for closed user accounts [#5640](https://github.com/diaspora/diaspora/pull/5640) * Disable email notifications for closed user accounts [#5640](https://github.com/diaspora/diaspora/pull/5640)
* Total user statistic no longer includes closed accounts [#5041](https://github.com/diaspora/diaspora/pull/5041) * Total user statistic no longer includes closed accounts [#5041](https://github.com/diaspora/diaspora/pull/5041)
* Don't add a space when rendering a mention [#5711](https://github.com/diaspora/diaspora/pull/5711) * Don't add a space when rendering a mention [#5711](https://github.com/diaspora/diaspora/pull/5711)
* Fix flickering hovercards [#5714](https://github.com/diaspora/diaspora/pull/5714)
## Features ## Features
* Don't pull jQuery from a CDN by default [#5105](https://github.com/diaspora/diaspora/pull/5105) * Don't pull jQuery from a CDN by default [#5105](https://github.com/diaspora/diaspora/pull/5105)
...@@ -1202,7 +1203,7 @@ The new configuration system allows all possible settings to be overriden by env ...@@ -1202,7 +1203,7 @@ The new configuration system allows all possible settings to be overriden by env
### Environment variable changes: ### Environment variable changes:
#### deprectated #### deprecated
* REDISTOGO_URL in favour of REDIS_URL or ENVIRONMENT_REDIS * REDISTOGO_URL in favour of REDIS_URL or ENVIRONMENT_REDIS
......
...@@ -16,7 +16,7 @@ app.views.Hovercard = app.views.Base.extend({ ...@@ -16,7 +16,7 @@ app.views.Hovercard = app.views.Base.extend({
.on('mouseleave', '.hovercardable', _.bind(this._mouseleaveHandler, this)); .on('mouseleave', '.hovercardable', _.bind(this._mouseleaveHandler, this));
this.show_me = false; this.show_me = false;
this.parent = null; // current 'hovercarable' element that caused HC to appear this.parent = null; // current 'hovercardable' element that caused HC to appear
// cache some element references // cache some element references
this.avatar = this.$('.avatar'); this.avatar = this.$('.avatar');
...@@ -61,7 +61,10 @@ app.views.Hovercard = app.views.Base.extend({ ...@@ -61,7 +61,10 @@ app.views.Hovercard = app.views.Base.extend({
_mouseleaveHandler: function(event) { _mouseleaveHandler: function(event) {
if( this.active === false || if( this.active === false ||
$.contains(this.el, event.relatedTarget) ) { return false; } $.contains(this.el, event.relatedTarget) ) { return false; }
if( this.mouseIsOverElement(this.parent, event) ||
this.mouseIsOverElement(this.$el, event) ) { return false; }
this.show_me = false; this.show_me = false;
if( this.$el.is(':visible') ) { if( this.$el.is(':visible') ) {
...@@ -137,6 +140,14 @@ app.views.Hovercard = app.views.Base.extend({ ...@@ -137,6 +140,14 @@ app.views.Hovercard = app.views.Base.extend({
top: p_pos.top + p_height - 25, top: p_pos.top + p_height - 25,
left: p_pos.left left: p_pos.left
}); });
} },
mouseIsOverElement: function(element, event) {
var el_pos = element.offset();
return event.pageX >= el_pos.left &&
event.pageX <= el_pos.left + element.width() &&
event.pageY >= el_pos.top &&
event.pageY <= el_pos.top + element.height();
},
}); });
// @license-end // @license-end
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter