Remember selected choice tab when doing a page refresh in JS (#2110)

This commit is contained in:
Maxime Besson 2020-03-27 19:03:56 +01:00
parent 8c94bf0f13
commit 05a23480b0
7 changed files with 18 additions and 5 deletions

View File

@ -227,6 +227,11 @@ datas = {}
$(window).on 'load', () ->
# Get application/init variables
datas = getValues()
# Keep the currently selected tab
if "datas" of window && "choicetab" of window.datas
datas.choicetab = window.datas.choicetab;
# Export datas for other scripts
window.datas = datas

View File

@ -1,4 +1,4 @@
$(document).ready(function() {
$(window).on("load", function() {
// Adapt some class to fit Bootstrap theme
$("div.message-positive").addClass("alert-success");
@ -16,4 +16,9 @@ $(document).ready(function() {
}
});
// Remember selected tab
$('#authMenu .nav-link').on('click', function (e) {
window.datas.choicetab = e.target.hash.substr(1)
});
});

View File

@ -1 +1 @@
$(document).ready(function(){$("div.message-positive").addClass("alert-success"),$("div.message-warning").addClass("alert-warning"),$("div.message-negative").addClass("alert-danger"),$("table.info").addClass("table"),$(".notifCheck").addClass("checkbox"),$('.collapse li[class!="dropdown"]').on("click",function(){$(".navbar-toggler").hasClass("collapsed")||$(".navbar-toggler").trigger("click")})});
$(window).on("load",function(){$("div.message-positive").addClass("alert-success"),$("div.message-warning").addClass("alert-warning"),$("div.message-negative").addClass("alert-danger"),$("table.info").addClass("table"),$(".notifCheck").addClass("checkbox"),$('.collapse li[class!="dropdown"]').on("click",function(){$(".navbar-toggler").hasClass("collapsed")||$(".navbar-toggler").trigger("click")}),$("#authMenu .nav-link").on("click",function(a){window.datas.choicetab=a.target.hash.substr(1)})});

View File

@ -1 +1 @@
{"version":3,"sources":["lemonldap-ng-portal/site/htdocs/static/bootstrap/js/skin.js"],"names":["$","document","ready","addClass","on","hasClass","trigger"],"mappings":"AAAAA,EAAEC,UAAUC,MAAM,WAGhBF,EAAE,wBAAwBG,SAAS,iBACnCH,EAAE,uBAAuBG,SAAS,iBAClCH,EAAE,wBAAwBG,SAAS,gBAEnCH,EAAE,cAAcG,SAAS,SAEzBH,EAAE,eAAeG,SAAS,YAG1BH,EAAE,mCAAmCI,GAAG,QAAS,WAC1CJ,EAAE,mBAAmBK,SAAS,cACjCL,EAAE,mBAAmBM,QAAQ"}
{"version":3,"sources":["lemonldap-ng-portal/site/htdocs/static/bootstrap/js/skin.js"],"names":["$","window","on","addClass","hasClass","trigger","e","datas","choicetab","target","hash","substr"],"mappings":"AAAAA,EAAEC,QAAQC,GAAG,OAAQ,WAGnBF,EAAE,wBAAwBG,SAAS,iBACnCH,EAAE,uBAAuBG,SAAS,iBAClCH,EAAE,wBAAwBG,SAAS,gBAEnCH,EAAE,cAAcG,SAAS,SAEzBH,EAAE,eAAeG,SAAS,YAG1BH,EAAE,mCAAmCE,GAAG,QAAS,WAC1CF,EAAE,mBAAmBI,SAAS,cACjCJ,EAAE,mBAAmBK,QAAQ,WAKjCL,EAAE,uBAAuBE,GAAG,QAAS,SAAUI,GAC3CL,OAAOM,MAAMC,UAAYF,EAAEG,OAAOC,KAAKC,OAAO"}

View File

@ -225,6 +225,9 @@ LemonLDAP::NG Portal jQuery scripts
$(window).on('load', function() {
var action, al, authMenuIndex, authMenuTabs, back_url, i, l, lang, langdiv, langs, langs2, len, len1, len2, len3, link, m, menuIndex, menuTabs, method, n, nl, nlangs, queryLang, queryString, re, ref, ref1, ref2, setCookieLang, urlParams;
datas = getValues();
if ("datas" in window && "choicetab" in window.datas) {
datas.choicetab = window.datas.choicetab;
}
window.datas = datas;
$("#appslist").sortable({
axis: "y",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long