move meeting refresh to the url input field

This commit is contained in:
Zachary Chai
2016-11-24 13:57:06 -05:00
parent ded0f9b056
commit 08ecae0ef6
4 changed files with 17 additions and 23 deletions

View File

@ -131,8 +131,7 @@
}
};
var initMeetings = function() {
var initIndex = function() {
$('.generate-link').click (function (e) {
e.preventDefault();
var newId = Math.trunc(Math.random() * 1000000000);
@ -140,11 +139,11 @@
$('.meeting-url').val(Meeting.buildMeetingURL());
});
if (meetingId = $(".page-wrapper.meetings").data('id')) {
$('.meeting-url').val(Meeting.getInstance().getURL());
} else {
$('.generate-link').click();
}
$('.generate-link').click();
};
var initMeetings = function() {
$('.meeting-url').val(Meeting.getInstance().getURL());
};
var initRooms = function() {
@ -158,7 +157,7 @@
if ($("body[data-controller=landing]").get(0)) {
init();
if ($("body[data-action=index]").get(0)) {
initMeetings();
initIndex();
} else if ($("body[data-action=meetings]").get(0)) {
initMeetings();
} else if ($("body[data-action=rooms]").get(0)) {

View File

@ -1,20 +1,7 @@
<% content_for :title do %>
<div class="title">
<%= t('hi_all') %>
<h2><%= t('create_session') %></h2>
</div>
<small>
<%= t('session_url_explanation') %>
</small>
<% end %>
<% if !@meeting_id %>
<% content_for :footer do %>
<div class="panel-footer">
<div class="text-center">
<%= t('refresh_html') %>
</div>
</div>
<% end %>
<% end %>
<div class="page-wrapper meetings">

View File

@ -2,6 +2,13 @@
<div class="input-group">
<input type="text" class="form-control meeting-url"/>
<span class="input-group-btn">
<% if params[:action] == 'index' %>
<button type="button" class="btn btn-default generate-link has-tooltip"
title="<%= t('url_refresh_hint') %>"
>
<i class="fa fa-refresh" aria-hidden="true"></i>
</button>
<% end %>
<button type="button" class="btn btn-default meeting-url-copy has-tooltip"
title="<%= t('url_copy_explanation') %>"
data-copied-hint="<%= t('copied') %>"