summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStephen Beaver <sbeaver@netgate.com>2016-08-15 08:59:07 -0400
committerStephen Beaver <sbeaver@netgate.com>2016-08-15 08:59:07 -0400
commitfd778d8bef8ea3b0e5dcc8007de242b6e2ac6d5a (patch)
treeb752a56d14a066859e6cff8133152c0b94e2c5c9 /src
parent65d08bad6c74b553469319b3128f07ce276655b7 (diff)
downloadpfsense-fd778d8bef8ea3b0e5dcc8007de242b6e2ac6d5a.zip
pfsense-fd778d8bef8ea3b0e5dcc8007de242b6e2ac6d5a.tar.gz
Fixed #6704
Diffstat (limited to 'src')
-rw-r--r--src/usr/local/www/diag_edit.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/usr/local/www/diag_edit.php b/src/usr/local/www/diag_edit.php
index 595be43..9047222 100644
--- a/src/usr/local/www/diag_edit.php
+++ b/src/usr/local/www/diag_edit.php
@@ -193,9 +193,22 @@ print_callout(gettext("The capabilities offered here can be dangerous. No suppor
$("#btngoto").prop('type','button');
+ //On clicking the GoTo button, validate the entered value
+ // and highlight the required line
$('#btngoto').click(function() {
var tarea = document.getElementById("fileContent");
- showLine(tarea, $('#gotoline').val());
+ var gtl = $('#gotoline').val();
+ var lines = $("#fileContent").val().split(/\r|\r\n|\n/).length;
+
+ if (gtl < 1) {
+ gtl = 1;
+ }
+
+ if (gtl > lines) {
+ gtl = lines;
+ }
+
+ showLine(tarea, gtl);
});
});
OpenPOWER on IntegriCloud