summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/firewall_nat_npt.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr/local/www/firewall_nat_npt.php')
-rw-r--r--src/usr/local/www/firewall_nat_npt.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/usr/local/www/firewall_nat_npt.php b/src/usr/local/www/firewall_nat_npt.php
index d57d3f0..2317dbd 100644
--- a/src/usr/local/www/firewall_nat_npt.php
+++ b/src/usr/local/www/firewall_nat_npt.php
@@ -281,12 +281,29 @@ events.push(function() {
cursor: 'grabbing',
update: function(event, ui) {
$('#order-store').removeAttr('disabled');
+ dirty = true;
}
});
// Check all of the rule checkboxes so that their values are posted
$('#order-store').click(function () {
$('[id^=frc]').prop('checked', true);
+
+ // Suppress the "Do you really want to leave the page" message
+ saving = true;
+ });
+
+ // Globals
+ saving = false;
+ dirty = false;
+
+ // provide a warning message if the user tries to change page before saving
+ $(window).bind('beforeunload', function(){
+ if (!saving && dirty) {
+ return ("<?=gettext('You have moved one or more NPt mappings but have not yet saved')?>");
+ } else {
+ return undefined;
+ }
});
});
//]]>
OpenPOWER on IntegriCloud