1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-25 11:37:22 +02:00

Open and validate activities

This commit is contained in:
Yohann D'ANELLO
2020-03-27 22:48:20 +01:00
parent d6e202a26f
commit 8c1d902c30
6 changed files with 121 additions and 18 deletions

View File

@ -28,15 +28,35 @@ function addMsg(msg, alert_type) {
+ msg + "</div>\n";
msgDiv.html(html);
}
/**
* add Muliple error message from err_obj
* @param err_obj {error_code:erro_message}
* @param errs_obj [{error_code:erro_message}]
*/
function errMsg(errs_obj){
for (const err_msg of Object.values(errs_obj)) {
addMsg(err_msg,'danger');
}
}
var reloadWithTurbolinks = (function () {
var scrollPosition;
function reload () {
scrollPosition = [window.scrollX, window.scrollY];
Turbolinks.visit(window.location.toString(), { action: 'replace' })
}
document.addEventListener('turbolinks:load', function () {
if (scrollPosition) {
window.scrollTo.apply(window, scrollPosition);
scrollPosition = null
}
});
return reload;
})();
/**
* Reload the balance of the user on the right top corner
*/