Skip to content

Commit

Permalink
Dismiss modal on successful email / SMS form submission
Browse files Browse the repository at this point in the history
Co-authored-by: Nikitas Tampakis <nikitas.tampakis@gmail.com>
  • Loading branch information
camillevilla and tampakis committed Mar 29, 2018
1 parent 7720668 commit 23371bd
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 18 deletions.
20 changes: 11 additions & 9 deletions app/views/catalog/email_success.html.erb
@@ -1,11 +1,13 @@
<div class="modal-header">
<h1><%= t('blacklight.email.form.title') %></h1>
<button type="button" class="blacklight-modal-close close" data-dismiss="modal" aria-label="<%= t('blacklight.modal.close') %>">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div data-blacklight-modal="container">
<div class="modal-header">
<h1><%= t('blacklight.email.form.title') %></h1>
<button type="button" class="blacklight-modal-close close" data-dismiss="modal" aria-label="<%= t('blacklight.modal.close') %>">
<span aria-hidden="true">&times;</span>
</button>
</div>

<div class="modal-body">
<%= render partial: '/shared/flash_msg' %>
<span data-blacklight-modal="close"></span>
<div class="modal-body">
<%= render partial: '/shared/flash_msg' %>
<span data-blacklight-modal="close"></span>
</div>
</div>
20 changes: 11 additions & 9 deletions app/views/catalog/sms_success.html.erb
@@ -1,11 +1,13 @@
<div class="modal-header">
<h1 class="modal-title"><%= t('blacklight.sms.form.title') %></h1>
<button type="button" class="blacklight-modal-close close" data-dismiss="modal" aria-label="<%= t('blacklight.modal.close') %>">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div data-blacklight-modal="container">
<div class="modal-header">
<h1 class="modal-title"><%= t('blacklight.sms.form.title') %></h1>
<button type="button" class="blacklight-modal-close close" data-dismiss="modal" aria-label="<%= t('blacklight.modal.close') %>">
<span aria-hidden="true">&times;</span>
</button>
</div>

<div class="modal-body">
<%= render partial: '/shared/flash_msg' %>
<span data-blacklight-modal="close"></span>
<div class="modal-body">
<%= render partial: '/shared/flash_msg' %>
<span data-blacklight-modal="close"></span>
</div>
</div>
9 changes: 9 additions & 0 deletions spec/views/catalog/email_success.html.erb_spec.rb
@@ -0,0 +1,9 @@
# frozen_string_literal: true

RSpec.describe "catalog/email_success.html.erb" do

it "includes the data-blacklight-modal properties" do
render
expect(rendered).to have_selector "div[data-blacklight-modal=container]"
end
end
9 changes: 9 additions & 0 deletions spec/views/catalog/sms_success.html.erb_spec.rb
@@ -0,0 +1,9 @@
# frozen_string_literal: true

RSpec.describe "catalog/sms_success.html.erb" do

it "includes the data-blacklight-modal properties" do
render
expect(rendered).to have_selector "div[data-blacklight-modal=container]"
end
end

0 comments on commit 23371bd

Please sign in to comment.