From 663fd954b58e8b6376ecf67110876fa91f0008df Mon Sep 17 00:00:00 2001 From: Udo Walter Date: Wed, 18 Oct 2017 15:50:13 +0200 Subject: [locations] added warning if subnets are marked for deletion; locations now scroll into view; subnet list now sorted by startip; --- .../locations/templates/locations.html | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) (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 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('\ @@ -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(); + } +} // --> -- cgit v1.2.3-55-g7522