Fix an unbound id error in JS

When focusing on a preference option, the status line
is supposed to change to the the preference's description.
However, because the variable that stores descriptions
is declared in a wrong scope, it results in an unbound id error
and nothing changes. This PR fixes the problem.
This commit is contained in:
Sorawee Porncharoenwase 2020-10-01 18:06:26 -07:00 committed by Matthew Flatt
parent 2a66eddcc9
commit b3e27ca69c

View File

@ -4,6 +4,8 @@ var key_handler, toggle_panel, hide_prefs, new_query, refine_query,
set_results_num, set_type_delay, set_highlight_color, status_line,
saved_status = false, ctx_query_label_line;
var descriptions = new Array();
(function(){
// Configuration options (use || in case a cookie exists but is empty)
@ -32,7 +34,7 @@ function MakePref(label, input) {
return '<tr><td align="right">' + label + ':&nbsp;&nbsp;</td>'
+'<td>' + input + '</td></tr>';
}
var descriptions = new Array();
function PrefInputArgs(name, desc) {
// don't plant `desc' directly in the text -- it might have quotes
descriptions[name] = desc;