diff options
author | Phil Davis <phil.davis@inf.org> | 2016-01-25 21:55:07 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2016-01-25 21:55:07 +0545 |
commit | ae6814a2df87d58d3b69db12f9f2624f8876226f (patch) | |
tree | 57a0f6e2203b620c80370cb6681b4c5081bb990f /src/usr/local/www/firewall_nat_out.php | |
parent | 8a4913ffd07a9dee27d8c408f6936cfb3ab6c2f7 (diff) | |
download | pfsense-ae6814a2df87d58d3b69db12f9f2624f8876226f.zip pfsense-ae6814a2df87d58d3b69db12f9f2624f8876226f.tar.gz |
Add leaving page message to NAT pages
These pages use the draggable/sortable rows stuff, so could use the same
warning message if the user tries to change page before saving
Diffstat (limited to 'src/usr/local/www/firewall_nat_out.php')
-rw-r--r-- | src/usr/local/www/firewall_nat_out.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/usr/local/www/firewall_nat_out.php b/src/usr/local/www/firewall_nat_out.php index f0a66dc..c0d696e 100644 --- a/src/usr/local/www/firewall_nat_out.php +++ b/src/usr/local/www/firewall_nat_out.php @@ -684,12 +684,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 NAT outbound mappings but have not yet saved')?>"); + } else { + return undefined; + } }); }); //]]> |