From de5d61d64e61f266a6f9196f21cec0d7816150c2 Mon Sep 17 00:00:00 2001 From: ljf Date: Sun, 20 Oct 2019 01:29:27 +0200 Subject: [PATCH] [fix] Restore top scroll with c.view --- src/js/yunohost/controllers/users.js | 4 +++- src/js/yunohost/helpers.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/js/yunohost/controllers/users.js b/src/js/yunohost/controllers/users.js index 73a450c4..7e58d8d8 100644 --- a/src/js/yunohost/controllers/users.js +++ b/src/js/yunohost/controllers/users.js @@ -50,7 +50,9 @@ model.groups[group].members.sort(); model.groups[group].membersInv.sort(); } - c.view('user/user_permission', model, function () { + + var rendered = c.render('views/user/user_permission.ms', model); + rendered.swap(function () { jQuery(".group-update").on('click', function (e) { updateGroup(model, jQuery(this)[0].dataset); return false; diff --git a/src/js/yunohost/helpers.js b/src/js/yunohost/helpers.js index 64465cf8..30fae9e2 100644 --- a/src/js/yunohost/helpers.js +++ b/src/js/yunohost/helpers.js @@ -276,7 +276,7 @@ callback(); // Force scrollTop on page load - //$('html, body').scrollTop(0); + $('html, body').scrollTop(0); }); };