focus input on load and enter key submits join

This commit is contained in:
Zachary Chai 2016-11-15 17:39:09 -05:00
parent 878f72cc56
commit b0d0d13855
1 changed files with 15 additions and 0 deletions

View File

@ -15,6 +15,7 @@
var init = function() {
Meeting.clear();
// setup click handlers
$('.center-panel-wrapper').on ('click', '.meeting-join', function (event) {
var name = $('.meeting-user-name').val();
Meeting.getInstance().setName(name);
@ -32,6 +33,13 @@
});
});
$('.center-panel-wrapper').on ('keypress', '.meeting-user-name', function (event) {
if (event.keyCode === 13) {
event.preventDefault();
$('.meeting-join').click();
}
});
$('.center-panel-wrapper').on ('click', '.meeting-end', function (event) {
var jqxhr = Meeting.getInstance().endMeeting();
var btn = $(this);
@ -64,6 +72,13 @@
}
};
$('#recordings').popover(options);
// focus user
if ($('.meeting-user-name').is(':visible')) {
$('.meeting-user-name').focus();
} else {
$('.meeting-join').focus();
}
};
var initIndex = function() {