diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2016-08-15 08:59:07 -0400 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2016-08-15 09:00:14 -0400 |
commit | d48792448693bd755af6af50273f166321467ebe (patch) | |
tree | 51688f5f918570de95fe0fa6034cc4c999f08996 /src | |
parent | f92fa4da514ad8e865c03262d20c530bd8067dd4 (diff) | |
download | pfsense-d48792448693bd755af6af50273f166321467ebe.zip pfsense-d48792448693bd755af6af50273f166321467ebe.tar.gz |
Fixed #6704
(cherry picked from commit fd778d8bef8ea3b0e5dcc8007de242b6e2ac6d5a)
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 e3f31eb..51af26a 100644 --- a/src/usr/local/www/diag_edit.php +++ b/src/usr/local/www/diag_edit.php @@ -225,9 +225,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); }); }); |