stop event propagation with button.press if desired. fixes #64.

This commit is contained in:
Christopher Jeffrey 2014-06-05 01:12:47 -05:00
parent 6f91361197
commit e265779369

View File

@ -5092,13 +5092,13 @@ function Button(options) {
this.on('keypress', function(ch, key) {
if (key.name === 'enter' || key.name === 'space') {
self.press();
return self.press();
}
});
if (this.options.mouse) {
this.on('click', function() {
self.press();
return self.press();
});
}
}
@ -5109,8 +5109,9 @@ Button.prototype.type = 'button';
Button.prototype.press = function() {
this.value = true;
this.emit('press');
var result = this.emit('press');
delete this.value;
return result;
};
/**