A bug in Control.onmouseout() handler - or not?
If I click on a button, such as the one in the button quickref example, the Control.onmousedown() adds a aw-mousedown-button class to the button, which causes the button to be highlighted. Control.onmouseup() contains the corresponding code to clear the class/highlight when the mouse-up event is received.
My bug, if it is one, is that if I click down on the UI-button but move the mouse way from the UI-button while the mouse-button is depressed, then the UI-button remains highlighted. It would seem that Control.onmouseout() should have code similar to onmouseup() to clear the added class, i.e.:
obj.onControlMouseOut = function(event){
var e = AW.srcElement(event);
while(e) {
if (e.getAttribute && e.getAttribute("aw")){
if (e.getAttribute("aw") != "control") {
e.className = e.className.replace(/ aw-mousedown-\w+/g, "");
}
}
if (e.getAttribute && e.getAttribute("awx")){
e.className = e.className.replace(/ aw-mousedown-\w+/g, "");
}
e = e.parentNode;
}
}
Equally, Control.onmouseover() could have code similar to onmousedown(), so that when the user clicks outside of the button then moves the mouse onto the UI-button while the mouse-button is depressed. However, there seems to be no way in a mouseover event to determine whether the mouse button is down or up.
My bug, if it is one, is that if I click down on the UI-button but move the mouse way from the UI-button while the mouse-button is depressed, then the UI-button remains highlighted. It would seem that Control.onmouseout() should have code similar to onmouseup() to clear the added class, i.e.:
obj.onControlMouseOut = function(event){
var e = AW.srcElement(event);
while(e) {
if (e.getAttribute && e.getAttribute("aw")){
if (e.getAttribute("aw") != "control") {
e.className = e.className.replace(/ aw-mousedown-\w+/g, "");
}
}
if (e.getAttribute && e.getAttribute("awx")){
e.className = e.className.replace(/ aw-mousedown-\w+/g, "");
}
e = e.parentNode;
}
}
Equally, Control.onmouseover() could have code similar to onmousedown(), so that when the user clicks outside of the button then moves the mouse onto the UI-button while the mouse-button is depressed. However, there seems to be no way in a mouseover event to determine whether the mouse button is down or up.
LostInSpace
December 12,