Skip to content

Commit

Permalink
Merge pull request craftpip#404 from amikot/patch-1
Browse files Browse the repository at this point in the history
Removed scroll to top on content height change.
  • Loading branch information
craftpip committed Oct 1, 2018
2 parents b6b5f61 + ebe7d86 commit 0eb97a2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions js/jquery-confirm.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,9 +547,12 @@
if(that.smoothContent){
var contentHeight = that.$content.outerHeight() || 0;
if(contentHeight !== prevContentHeight){
that.$contentPane.css({
'height': contentHeight
}).scrollTop(0);

// Commented out to prevent scroll to top when updating the content
// (for example when using ajax in forms in content)
// that.$contentPane.css({
// 'height': contentHeight
// }).scrollTop(0);
prevContentHeight = contentHeight;
}
var wh = $(window).height();
Expand Down Expand Up @@ -1369,4 +1372,4 @@
$(document).on('mousedown', 'button, a', function(){
jconfirm.lastClicked = $(this);
});
}));
}));

0 comments on commit 0eb97a2

Please sign in to comment.