summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/js
diff options
context:
space:
mode:
authorjskyboo <jack@ron.hog.mooo.info>2017-01-25 19:22:08 -0800
committerRenato Botelho <renato@netgate.com>2017-01-27 11:24:17 -0200
commit7533bdcff80a5b3643530fbb7b8a78e2ac201b30 (patch)
treefc9dca88c1f4b3edbc78ab34377a4d08d61c7936 /src/usr/local/www/js
parent20290428cc093d43d8ee15cd1eb75026d30d0a93 (diff)
downloadpfsense-7533bdcff80a5b3643530fbb7b8a78e2ac201b30.zip
pfsense-7533bdcff80a5b3643530fbb7b8a78e2ac201b30.tar.gz
Bug #7164 Limit NTP time source fields to the maximum number saved to configuration.
(cherry picked from commit 5a1d67b17d485697e19ef49d66e8e5f91e7e884d)
Diffstat (limited to 'src/usr/local/www/js')
-rw-r--r--src/usr/local/www/js/pfSenseHelpers.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/usr/local/www/js/pfSenseHelpers.js b/src/usr/local/www/js/pfSenseHelpers.js
index e8898ba..80d3361 100644
--- a/src/usr/local/www/js/pfSenseHelpers.js
+++ b/src/usr/local/www/js/pfSenseHelpers.js
@@ -314,7 +314,16 @@ function checkLastRow() {
function add_row() {
// Find the last repeatable group
- var lastRepeatableGroup = $('.repeatable:last');
+ var lastRepeatableGroup = $('.repeatable:last');
+
+ // If the number of repeats exceeds the maximum, do not add another clone
+ if ($('.repeatable').length >= lastRepeatableGroup.attr('max_repeats')) {
+ // Alert user if alert message is specified
+ if (typeof lastRepeatableGroup.attr('max_repeats_alert') !== 'undefined') {
+ alert(lastRepeatableGroup.attr('max_repeats_alert'));
+ }
+ return;
+ }
// Clone it
var newGroup = lastRepeatableGroup.clone();
OpenPOWER on IntegriCloud