diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2016-08-15 08:59:07 -0400 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2016-08-15 08:59:07 -0400 |
commit | fd778d8bef8ea3b0e5dcc8007de242b6e2ac6d5a (patch) | |
tree | b752a56d14a066859e6cff8133152c0b94e2c5c9 /src | |
parent | 65d08bad6c74b553469319b3128f07ce276655b7 (diff) | |
download | pfsense-fd778d8bef8ea3b0e5dcc8007de242b6e2ac6d5a.zip pfsense-fd778d8bef8ea3b0e5dcc8007de242b6e2ac6d5a.tar.gz |
Fixed #6704
Diffstat (limited to 'src')
-rw-r--r-- | src/usr/local/www/diag_edit.php | 15 |
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); }); }); |