Merge pull request #25 from beatriceo/modal-fixes

fixed calling modal
This commit is contained in:
Beatrice Olivera 2018-08-31 11:30:05 +01:00 committed by GitHub
commit d0803e7e72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 5 deletions

View File

@ -36,7 +36,6 @@ class PagesController < ApplicationController
chat_room_id: chat_room.id chat_room_id: chat_room.id
} }
}) })
end end
def accept_call def accept_call

View File

@ -0,0 +1,8 @@
import "bootstrap";
const btn = document.getElementById("modalTrigger");
const modal = document.getElementById("myModal");
btn.addEventListener('click', function(event) {
$('#myModal').modal('show');
});

View File

@ -18,13 +18,14 @@ end
</div> </div>
</div> </div>
<div class="call" data-user-id="<%= contact.id %>"> <div class="call" data-user-id="<%= contact.id %>">
<%= link_to establish_call_path(contact.id), 'data-toggle':"modal", 'data-target':"#myModal" do %> <%= link_to establish_call_path(contact.id), remote: true, id: "modalTrigger" do %>
<i class="fas fa-phone"></i> <i class="fas fa-phone"></i>
<% end %> <% end %>
</div> </div>
</div> </div>
<!-- Modal --> <!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="vertical-alignment-helper"> <div class="vertical-alignment-helper">
@ -58,3 +59,6 @@ end
</div> </div>
</div> </div>
</div> </div>
<%= javascript_pack_tag 'modal' %>

View File

@ -15,6 +15,8 @@ module Polyglot
end end
# Initialize configuration defaults for originally generated Rails version. # Initialize configuration defaults for originally generated Rails version.
config.load_defaults 5.2 config.load_defaults 5.2
config.action_view.embed_authenticity_token_in_remote_forms = true
# Settings in config/environments/* take precedence over those specified here. # Settings in config/environments/* take precedence over those specified here.
# Application configuration can go into files in config/initializers # Application configuration can go into files in config/initializers

View File

@ -10,9 +10,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2018_08_30_100110) do
# ActiveRecord::Schema.define(version: 2018_08_30_100110) do
ActiveRecord::Schema.define(version: 2018_08_29_123204) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"