Skip to content

Commit

Permalink
craftpip#255 child margins don't affect parent height
Browse files Browse the repository at this point in the history
  • Loading branch information
craftpip committed Jun 22, 2017
1 parent 148068a commit 36f18f7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
3 changes: 3 additions & 0 deletions css/jquery-confirm.css
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,9 @@ body[class*=jconfirm-no-scroll-] {
background: #666;
border-radius: 3px;
}
.jconfirm .jconfirm-box div.jconfirm-content-pane .jconfirm-content {
overflow: auto;
}
.jconfirm .jconfirm-box div.jconfirm-content-pane .jconfirm-content img {
max-width: 100%;
height: auto;
Expand Down
8 changes: 2 additions & 6 deletions css/jquery-confirm.less
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,8 @@ body[class*=jconfirm-no-scroll-] {
}

.jconfirm-content {
//position: absolute;
//top: 0;
//left: 0;
//transition: all .2s ease-in;
//right: 0;

overflow: auto;

img {
max-width: 100%;
height: auto;
Expand Down
18 changes: 11 additions & 7 deletions js/jquery-confirm.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ var jconfirm, Jconfirm;
},
_updateContentMaxHeight: function () {
var height = $(window).height() - (this.$jconfirmBox.outerHeight() - this.$contentPane.outerHeight()) - (this.offsetTop + this.offsetBottom);
console.log($(window).height(), this.$jconfirmBox.outerHeight() - this.$contentPane.outerHeight());
// console.log($(window).height(), this.$jconfirmBox.outerHeight() - this.$contentPane.outerHeight());

this.$contentPane.css({
'max-height': height + 'px'
Expand Down Expand Up @@ -501,12 +501,16 @@ var jconfirm, Jconfirm;
var that = this;
if (this._timer) clearInterval(this._timer);

var prevContentHeight = 0;
this._timer = setInterval(function () {
if (this.smoothContent) {
if (that.smoothContent) {
var contentHeight = that.$content.outerHeight() || 0;
that.$contentPane.css({
'height': contentHeight
}).scrollTop(0);
if (contentHeight !== prevContentHeight) {
that.$contentPane.css({
'height': contentHeight
}).scrollTop(0);
prevContentHeight = contentHeight;
}
}

// var c = that.$el.find('.jconfirm-c').outerHeight();
Expand Down Expand Up @@ -1226,10 +1230,10 @@ var jconfirm, Jconfirm;
typeAnimated: true,
draggable: true,
dragWindowGap: 15,
dragWindowBorder: false,
dragWindowBorder: true,
animateFromElement: true,
alignMiddle: true,
smoothContent: false,
smoothContent: true,
content: 'Are you sure to continue?',
buttons: {},
defaultButtons: {
Expand Down

0 comments on commit 36f18f7

Please sign in to comment.