I tried to call a function when a mouse goes up above a subclass of goog.ui.Control:
/** @override */
myapp.MyButton.prototype.handleMouseUp =
function(e) {
goog.base(this, 'handleMouseUp', e);
alert('Woof!');
}
However, when I click on my button, not alert shows up. Why not? Doesn’t handleMouseUp get called when my mouse is raised after a click?
The source code for
goog.ui.Controlcontains the following comment:To see exactly which events are dispatched for various actions, take a look at the goog.ui.Control demo, which has a live event log.
In order to enable addition transition events,
goog.ui.Controlincludes the following method:For example, you could do the following to enable transition events for all states.
Now when the mouse button is down the
activateevent will be dispatched and upon releasing the mouse button thedeactivateevent will be dispatched.See the goog.ui.Button demo (in particular, the combined toggle buttons near the bottom of the page).