Index: lams_central/web/includes/javascript/main.js =================================================================== diff -u -r97deffe165055d02a9942930ec547b5ee040dc42 -ra856bd9adcfa3454d6f7f891a84f9e759a7e9000 --- lams_central/web/includes/javascript/main.js (.../main.js) (revision 97deffe165055d02a9942930ec547b5ee040dc42) +++ lams_central/web/includes/javascript/main.js (.../main.js) (revision a856bd9adcfa3454d6f7f891a84f9e759a7e9000) @@ -1,6 +1,6 @@ $(document).ready(function () { - // open active course. in case active course is not yet chosen by user, it will be opened after tablesorter's pager receives all orgs + // Open active course. If it's not yet chosen by user - it will be opened once tablesorter's pager receives all orgs if (activeOrgId != null) { loadOrganisation(); } @@ -140,7 +140,15 @@ //in case of any server error - open offcanvas bar so user can select another course if ( status == "error" ) { $("body").removeClass("offcanvas-hidden"); - } + return; + } + + // if screen is smaller than 768px (i.e. offcanvas occupies 100%) and offcanvas is shown - then hide it on user selecting an organisation + if (window.matchMedia('(max-width: 768px)').matches && !$("body").hasClass("offcanvas-hidden")) { + //do it with a small delay so it will be understood that the new organisation is selected indeed + $("body").addClass('offcanvas-hidden', 300); + } + } ); } Index: lams_central/web/main.jsp =================================================================== diff -u -r97deffe165055d02a9942930ec547b5ee040dc42 -ra856bd9adcfa3454d6f7f891a84f9e759a7e9000 --- lams_central/web/main.jsp (.../main.jsp) (revision 97deffe165055d02a9942930ec547b5ee040dc42) +++ lams_central/web/main.jsp (.../main.jsp) (revision a856bd9adcfa3454d6f7f891a84f9e759a7e9000) @@ -6,7 +6,6 @@ <%@ taglib uri="tags-core" prefix="c"%> <%@ taglib uri="tags-function" prefix="fn"%> <%@ taglib uri="tags-tiles" prefix="tiles" %> - @@ -91,7 +90,7 @@ MARK_ORG_FAVORITE : '' }, - activeOrgId = null${lastVisitedOrganisationId}; + activeOrgId = null${activeOrgId}; $(document).ready(function(){ <%-- If it's the user's first login, display a dialog asking if tutorial videos should be shown --%> @@ -138,7 +137,7 @@ -class="offcanvas-hidden"> +class="offcanvas-hidden">