update javascript and neaten up layout

This commit is contained in:
Zachary Chai
2017-01-24 16:13:12 -05:00
parent b30acae006
commit d7cd9eb8bb
5 changed files with 40 additions and 21 deletions

View File

@ -134,6 +134,14 @@
}
});
$('.center-panel-wrapper').on('keyup', '.meeting-name', function (event, msg) {
var newId = $(this).val();
Meeting.getInstance().setMeetingId(newId);
$(".page-wrapper.meetings").data('id', newId);
$('.meeting-url').val(Meeting.getInstance().getURL());
$('.join-meeting-title').html(I18n.join_title.replace(/%{id}/, newId));
})
// enable tooltips
var options = {
selector: '.has-tooltip',
@ -148,7 +156,9 @@
$(document).tooltip(options);
// focus name input or join button
if ($('.meeting-user-name').is(':visible')) {
if ($('.meeting-name').is(':visible')) {
$('.meeting-name').focus();
} else if ($('.meeting-user-name').is(':visible')) {
$('.meeting-user-name').focus();
} else {
$('.meeting-join').focus();
@ -156,15 +166,6 @@
};
var initIndex = function() {
$('.generate-link').click (function (e) {
e.preventDefault();
var newId = Math.trunc(Math.random() * 1000000000);
Meeting.getInstance().setMeetingId(newId);
$(".page-wrapper.meetings").data('id', newId);
$('.meeting-url').val(Meeting.getInstance().getURL());
});
$('.generate-link').click();
$('ul.previously-joined').empty();
var joinedMeetings = localStorage.getItem('joinedMeetings');