You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found nothing in the documentation about this.
I want to be able to bind the Enter and Esc keys to the different buttons in the various Vex pop-up variants.
Example Code (which doesn’t work):
vex.dialog.buttons.YES.text = 'Continue';
vex.dialog.buttons.NO.text = 'Cancel';
vex.dialog.confirm({
message: 'Any kind of question',
callback: function(value) {
if (value) {
console.log('confirm clicked');
function2invoke(param1, param2);
}
else {
console.log('cancel clicked');
differentFunction2invoke(param1, param2);
}
}
})
// make OK button respond to enter key and cancel button respond to escape key
$(document).bind("keyup.key13", function(event) {
var keycode = (event.keyCode ? event.keyCode : event.which);
console.log('keycode clicked: ' + keycode);
if (keycode == '13') {
console.log('confirm clicked');
function2invoke(param1, param2);
}
});
$(document).bind("keyup.key27", function(event) {
var keycode = (event.keyCode ? event.keyCode : event.which);
console.log('keycode clicked: ' + keycode);
if (keycode == '27') {
console.log('cancel clicked');
differentFunction2invoke(param1, param2);
}
});
The text was updated successfully, but these errors were encountered:
Found nothing in the documentation about this.
I want to be able to bind the Enter and Esc keys to the different buttons in the various Vex pop-up variants.
Example Code (which doesn’t work):
vex.dialog.buttons.YES.text = 'Continue';
vex.dialog.buttons.NO.text = 'Cancel';
vex.dialog.confirm({
message: 'Any kind of question',
callback: function(value) {
if (value) {
console.log('confirm clicked');
function2invoke(param1, param2);
}
else {
console.log('cancel clicked');
differentFunction2invoke(param1, param2);
}
}
})
// make OK button respond to enter key and cancel button respond to escape key
$(document).bind("keyup.key13", function(event) {
var keycode = (event.keyCode ? event.keyCode : event.which);
console.log('keycode clicked: ' + keycode);
if (keycode == '13') {
console.log('confirm clicked');
function2invoke(param1, param2);
}
});
$(document).bind("keyup.key27", function(event) {
var keycode = (event.keyCode ? event.keyCode : event.which);
console.log('keycode clicked: ' + keycode);
if (keycode == '27') {
console.log('cancel clicked');
differentFunction2invoke(param1, param2);
}
});
The text was updated successfully, but these errors were encountered: