summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2016-11-30 18:36:01 +0100
committerSimon Rettberg2016-11-30 18:36:01 +0100
commite047775b0a4d03a05afc34d0260d48a5e574046e (patch)
treee59c8d4ad884fae1b0af39f180cc96b9bf2f0bca
parent[locations] Don't scroll to top when opening location (diff)
downloadslx-admin-e047775b0a4d03a05afc34d0260d48a5e574046e.tar.gz
slx-admin-e047775b0a4d03a05afc34d0260d48a5e574046e.tar.xz
slx-admin-e047775b0a4d03a05afc34d0260d48a5e574046e.zip
[locations] Also make sure the opened location is in view
-rw-r--r--modules-available/locations/templates/locations.html3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules-available/locations/templates/locations.html b/modules-available/locations/templates/locations.html
index 06365cb6..c2dc610e 100644
--- a/modules-available/locations/templates/locations.html
+++ b/modules-available/locations/templates/locations.html
@@ -134,7 +134,7 @@ function slxOpenLocation(e, lid) {
if (existing.is(slxLastLocation)) {
slxLastLocation = false;
} else {
- existing.show();
+ existing.show()[0].scrollIntoView();
$(e).closest('tr').addClass('active slx-bold');
slxLastLocation = existing;
}
@@ -146,6 +146,7 @@ function slxOpenLocation(e, lid) {
$(e).closest('tr').addClass('active slx-bold').after(tr);
td.load('?do=Locations&action=showlocation&locationid=' + lid, function() {
slxAttachCidr();
+ $('#location-details-' + lid)[0].scrollIntoView();
});
slxLastLocation = tr;
}