mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUAC-842: Add onmouseout event to Guacamole.Mouse. Fix GUAC-833 while we're in here.
This commit is contained in:
@@ -100,6 +100,14 @@ Guacamole.Mouse = function(element) {
|
|||||||
*/
|
*/
|
||||||
this.onmousemove = null;
|
this.onmousemove = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fired whenever the mouse leaves the boundaries of the element associated
|
||||||
|
* with this Guacamole.Mouse.
|
||||||
|
*
|
||||||
|
* @event
|
||||||
|
*/
|
||||||
|
this.onmouseout = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Counter of mouse events to ignore. This decremented by mousemove, and
|
* Counter of mouse events to ignore. This decremented by mousemove, and
|
||||||
* while non-zero, mouse events will have no effect.
|
* while non-zero, mouse events will have no effect.
|
||||||
@@ -199,7 +207,7 @@ Guacamole.Mouse = function(element) {
|
|||||||
|
|
||||||
// Check that mouseout is due to actually LEAVING the element
|
// Check that mouseout is due to actually LEAVING the element
|
||||||
var target = e.relatedTarget || e.toElement;
|
var target = e.relatedTarget || e.toElement;
|
||||||
while (target !== null) {
|
while (target) {
|
||||||
if (target === element)
|
if (target === element)
|
||||||
return;
|
return;
|
||||||
target = target.parentNode;
|
target = target.parentNode;
|
||||||
@@ -220,6 +228,10 @@ Guacamole.Mouse = function(element) {
|
|||||||
guac_mouse.onmouseup(guac_mouse.currentState);
|
guac_mouse.onmouseup(guac_mouse.currentState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fire onmouseout event
|
||||||
|
if (guac_mouse.onmouseout)
|
||||||
|
guac_mouse.onmouseout();
|
||||||
|
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
// Override selection on mouse event element.
|
// Override selection on mouse event element.
|
||||||
|
Reference in New Issue
Block a user