Skip to content

Commit f41df18

Browse files
Modal vertical align center issue while data come from third party.
- Remove JavsScrip which is useed for modal vertical align center. - Added css for modal vertical align center. - Add ".pmd-modal-center" class beside ".modal"
1 parent 41dd312 commit f41df18

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

components/modal/css/modal.css

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
12
/*!
2-
* Propeller v1.0.0 (http://propeller.in)
3+
* Propeller v1.0.0 (http://propeller.in): modal.css
34
* Copyright 2016-2017 Digicorp, Inc.
45
* Licensed under MIT (http://propeller.in/LICENSE)
56
*/
@@ -23,7 +24,12 @@
2324
.modal .radio, .modal .checkbox{margin:16px 0;}
2425
.modal .radio-options > label{padding-left:32px;}
2526
.modal .list-group.pmd-list-avatar{margin:8px 4px;padding:0}
26-
.modal .list-group:last-child{margin-bottom:0;}
27+
.modal.list-group:last-child{margin-bottom:0;}
2728

2829
/* Form css */
2930
.form-horizontal .form-group{ margin-left:0; margin-right:0;}
31+
32+
/* Modal center */
33+
.pmd-modal-center { text-align:center; padding:0 !important;}
34+
.pmd-modal-center:before { content: ''; display:inline-block; height: 100%; vertical-align: middle; margin-right: -4px;}
35+
.pmd-modal-center .modal-dialog { display:inline-block; text-align:left; vertical-align:middle;}

components/modal/js/modal.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1+
12
/*!
2-
* Propeller v1.0.0 (http://propeller.in)
3+
* Propeller v1.0.0 (http://propeller.in): modal.js
34
* Copyright 2016-2017 Digicorp, Inc.
45
* Licensed under MIT (http://propeller.in/LICENSE)
56
*/
67

7-
// Modal -----------------------------------------------------------------//
8-
// Reposition when a modal is shown
98
function reposition() {
109
var modal = $(this),
1110
dialog = modal.find('.modal-dialog');

components/modal/modal.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ <h2>Propeller Modal</h2>
174174
<div class="col-md-4">
175175
<button data-target="#simple-dialog" data-toggle="modal" class="btn pmd-ripple-effect btn-primary pmd-z-depth" type="button">Alert</button>
176176

177-
<div tabindex="-1" class="modal fade" id="simple-dialog" style="display: none;" aria-hidden="true">
177+
<div tabindex="-1" class="modal pmd-modal-center fade" id="simple-dialog" style="display: none;" aria-hidden="true">
178178
<div class="modal-dialog">
179179
<div class="modal-content">
180180
<div class="modal-body">
@@ -188,9 +188,9 @@ <h2>Propeller Modal</h2>
188188

189189
<!-- Alert with title bar -->
190190
<div class="col-md-4">
191-
<button data-target="#complete-dialog" data-toggle="modal" class="btn pmd-ripple-effect btn-primary pmd-z-depth" type="button">Alert with title bar</button>
191+
<button data-target="#pmd-complete-dialog" data-toggle="modal" class="btn pmd-ripple-effect btn-primary pmd-z-depth" type="button">Alert with title bar</button>
192192

193-
<div tabindex="-1" class="modal fade" id="complete-dialog" style="display: none;" aria-hidden="true">
193+
<div tabindex="-1" class="modal pmd-modal-center fade" id="pmd-complete-dialog" style="display: none;" aria-hidden="true">
194194
<div class="modal-dialog">
195195
<div class="modal-content">
196196
<div class="modal-header">
@@ -210,9 +210,9 @@ <h2 class="pmd-card-title-text">Use Google's location service?</h2>
210210

211211
<!-- Alert without title bar -->
212212
<div class="col-md-4">
213-
<button data-target="#alert-dialog" data-toggle="modal" class="btn pmd-ripple-effect btn-primary pmd-z-depth" type="button">Alert without title bar</button>
213+
<button data-target="#pmd-alert-dialog" data-toggle="modal" class="btn pmd-ripple-effect btn-primary pmd-z-depth" type="button">Alert without title bar</button>
214214

215-
<div tabindex="-1" class="modal fade" id="alert-dialog" style="display: none;" aria-hidden="true">
215+
<div tabindex="-1" class="modal pmd-modal-center fade" id="pmd-alert-dialog" style="display: none;" aria-hidden="true">
216216
<div class="modal-dialog">
217217
<div class="modal-content">
218218
<div class="modal-body"> Would you like to proceed? </div>
@@ -770,7 +770,7 @@ <h2>Events</h2>
770770
<script type="text/javascript" src="http://propeller.in/components/textfield/js/textfield.js"></script>
771771

772772
<!-- Propeller modal js -->
773-
<script type="text/javascript" src="js/modal.js"></script>
773+
<!--<script type="text/javascript" src="js/modal.js"></script> -->
774774

775775
</body>
776776

0 commit comments

Comments
 (0)