Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 26 additions & 8 deletions css/bootstrap-modal.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,34 @@
left: 0;
right: 0;
overflow: auto;
text-align: center;
}

.modal-scrollable .modal {
text-align: left;
}

.modal-scrollable:after {
content: "";
height: 100%;
width: 0;
display: inline-block;
vertical-align: middle;
}

.modal {
outline: none;
position: absolute;
margin-top: 0;
top: 50%;
position: relative;
margin: 0;
width: auto;
top: auto;
left: auto;
right: auto;
bottom: auto;
overflow: visible; /* allow content to popup out (i.e tooltips) */
display: inline-block;
vertical-align: middle;
min-width: 530px;
}

.modal.fade {
Expand All @@ -55,7 +75,7 @@
}

.modal.fade.in {
top: 50%;
top: 0;
}

.modal-body {
Expand Down Expand Up @@ -91,8 +111,7 @@
}

.modal.container {
width: 940px;
margin-left: -470px;
max-width: 940px;
}

/* Modal Overflow */
Expand All @@ -118,8 +137,7 @@

@media (min-width: 1200px) {
.modal.container {
width: 1170px;
margin-left: -585px;
max-width: 1170px;
}
}

Expand Down
11 changes: 1 addition & 10 deletions js/bootstrap-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,6 @@

if (this.options.width){
this.$element.css('width', this.options.width);

var that = this;
this.$element.css('margin-left', function () {
if (/%/ig.test(that.options.width)){
return -(parseInt(that.options.width) / 2) + '%';
} else {
return -($(this).width() / 2) + 'px';
}
});
}

var prop = this.options.height ? 'height' : 'max-height';
Expand Down Expand Up @@ -352,4 +343,4 @@
});
});

}(window.jQuery);
}(window.jQuery);
6 changes: 2 additions & 4 deletions js/bootstrap-modalmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,12 @@
modal.$element.show();

if (transition) {
modal.$element[0].style.display = 'run-in';
modal.$element[0].offsetWidth;
modal.$element.one($.support.transition.end, function () { modal.$element[0].style.display = 'block' });
modal.$element.one($.support.transition.end, function () { modal.$element.show(); });
}

modal.$element
.toggleClass('modal-overflow', modalOverflow)
.css('margin-top', modalOverflow ? 0 : 0 - modal.$element.height()/2)
.addClass('in')
.attr('aria-hidden', false);

Expand Down Expand Up @@ -367,4 +365,4 @@

$.fn.modalmanager.Constructor = ModalManager

}(jQuery);
}(jQuery);