From ebe7d86e576f6f33d790410cf0d6a91afd426e7a Mon Sep 17 00:00:00 2001 From: amikot Date: Wed, 23 May 2018 14:37:01 +0100 Subject: [PATCH] Removed scroll to top on content height change. Now scroll position stays not changed when content height change. --- js/jquery-confirm.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/js/jquery-confirm.js b/js/jquery-confirm.js index aee245c..f9d5a15 100644 --- a/js/jquery-confirm.js +++ b/js/jquery-confirm.js @@ -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(); @@ -1369,4 +1372,4 @@ $(document).on('mousedown', 'button, a', function(){ jconfirm.lastClicked = $(this); }); -})); \ No newline at end of file +}));