From ca61a065f1cbbe86140ba1f1a9df6c4c3245f481 Mon Sep 17 00:00:00 2001 From: kload Date: Fri, 13 Nov 2015 12:40:51 -0500 Subject: [PATCH] [fix] Sliding effect The $.resize() function was called on the body too soon, leading the sliding effect to be invisible. Resizing after the duration of the CSS animation did the trick. --- src/js/app.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/js/app.js b/src/js/app.js index 1bcaab40..0581c4e7 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -226,6 +226,12 @@ var app = Sammy('#main', function (sam) { callback(); // Force scrollTop on page load $('html, body').scrollTop(0); + + // Resize body after the animation finishes (0.2s css transition) + // https://github.com/YunoHost/yunohost-admin/blob/231aac076a3aa836409b0d33fe02e48975990b7a/src/css/style.less#L92 + setTimeout(function() { + $('body').resize(); + }, 210); }); }; @@ -258,11 +264,9 @@ var app = Sammy('#main', function (sam) { callback(); // Force scrollTop on page load $('html, body').scrollTop(0); + $('body').resize(); }); } - - // Resize window according to updated content. - $('body').resize(); }, confirm: function(title, content, confirmCallback, cancelCallback) {