summaryrefslogtreecommitdiffstats
path: root/modules-available/locations/templates/locations.html
diff options
context:
space:
mode:
authorUdo Walter2017-10-18 15:50:13 +0200
committerUdo Walter2017-10-18 15:50:13 +0200
commit663fd954b58e8b6376ecf67110876fa91f0008df (patch)
treec89d5dbf4adbc9b086e02e0ca706154330d2796b /modules-available/locations/templates/locations.html
parent[sysconfig] removed redundant horizontal lines (diff)
downloadslx-admin-663fd954b58e8b6376ecf67110876fa91f0008df.tar.gz
slx-admin-663fd954b58e8b6376ecf67110876fa91f0008df.tar.xz
slx-admin-663fd954b58e8b6376ecf67110876fa91f0008df.zip
[locations] added warning if subnets are marked for deletion; locations now scroll into view; subnet list now sorted by startip;
Diffstat (limited to 'modules-available/locations/templates/locations.html')
-rw-r--r--modules-available/locations/templates/locations.html24
1 files changed, 24 insertions, 0 deletions
diff --git a/modules-available/locations/templates/locations.html b/modules-available/locations/templates/locations.html
index 238d6630..fb09a45e 100644
--- a/modules-available/locations/templates/locations.html
+++ b/modules-available/locations/templates/locations.html
@@ -157,6 +157,7 @@ function slxOpenLocation(e, lid) {
existing.show();
$(e).closest('tr').addClass('active slx-bold');
slxLastLocation = existing;
+ scollIntoView(existing);
}
return;
}
@@ -166,10 +167,24 @@ function slxOpenLocation(e, lid) {
$(e).closest('tr').addClass('active slx-bold').after(tr);
td.load('?do=Locations&action=showlocation&locationid=' + lid, function() {
slxAttachCidr();
+ scollIntoView(tr);
});
slxLastLocation = tr;
}
+function scollIntoView(el) {
+ var offset = $(el).offset();
+ var win = $(window);
+ var h = $(el).height();
+ if (offset.top + h > win.scrollTop() + win.height()) {
+ offset.top -= win.height();
+ offset.top += h;
+ $('html, body').animate({
+ scrollTop: offset.top
+ });
+ }
+}
+
function slxAddSubnetRow(e, lid) {
var tr = $('#loc-sub-' + lid);
tr.before('<tr id="row' + slxAddCounter + '" class="cidrmagic">\
@@ -189,5 +204,14 @@ function removeNewSubnetRow(r) {
function slxConfirm() {
return confirm('{{lang_areYouSureNoUndo}}');
}
+
+function deleteSubnetWarning(locid) {
+ var form = $("#locationForm"+locid);
+ if (form.find("input[type=checkbox]:checked").length > 0) {
+ $("#saveWarningModal"+locid).modal();
+ } else {
+ form.submit();
+ }
+}
// -->
</script>