From 1724b55abdfcee25fe58f5f9fb763e99081043c9 Mon Sep 17 00:00:00 2001
From: Udo Walter
Date: Wed, 13 Sep 2017 17:01:30 +0200
Subject: [locations] fixed inconsistencies + small design changes
---
.../locations/templates/locations.html | 46 +++++++++++++++-------
1 file changed, 32 insertions(+), 14 deletions(-)
(limited to 'modules-available/locations/templates/locations.html')
diff --git a/modules-available/locations/templates/locations.html b/modules-available/locations/templates/locations.html
index c2dc610e..15dcdd42 100644
--- a/modules-available/locations/templates/locations.html
+++ b/modules-available/locations/templates/locations.html
@@ -1,6 +1,7 @@
-
-
{{lang_thisListBySubnet}}
+
{{lang_locationsMainHeading}}
@@ -84,15 +85,17 @@
-
- |
@@ -111,17 +114,29 @@
var slxAddCounter = 0;
var slxLastLocation = false;
+var newRowCounter = 0;
+
function slxAddLocationRow() {
+ $("#saveLocationRows").show();
var tr = $('#lasttr');
- tr.before('\
- # | \
+ tr.before('
\
| \
| \
+ | \
');
slxAddCounter++;
+ newRowCounter++;
+}
+
+function removeNewLocationRow(r) {
+ $("#row"+r).remove();
+ newRowCounter--;
+ if (newRowCounter === 0) {
+ $("#saveLocationRows").hide();
+ }
}
function slxOpenLocation(e, lid) {
@@ -134,7 +149,7 @@ function slxOpenLocation(e, lid) {
if (existing.is(slxLastLocation)) {
slxLastLocation = false;
} else {
- existing.show()[0].scrollIntoView();
+ existing.show();
$(e).closest('tr').addClass('active slx-bold');
slxLastLocation = existing;
}
@@ -146,23 +161,26 @@ 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;
}
function slxAddSubnetRow(e, lid) {
var tr = $('#loc-sub-' + lid);
- tr.before('\
+ tr.before('
\
# | \
| \
| \
- | \
+ | \
');
slxAddCounter++;
slxAttachCidr();
}
+function removeNewSubnetRow(r) {
+ $("#row"+r).remove();
+}
+
function slxConfirm() {
return confirm('{{lang_areYouSureNoUndo}}');
}
--
cgit v1.2.3-55-g7522