improve status message clearing for input fields ("" is false in javascript)

svn: r10716
This commit is contained in:
Eli Barzilay 2008-07-11 08:48:53 +00:00
parent f44a06a4da
commit dc5211f363

View File

@ -30,13 +30,14 @@ function MakePref(label, input) {
} }
descriptions = new Array(); descriptions = new Array();
function PrefInputArgs(name, desc) { function PrefInputArgs(name, desc) {
// don't plant `desc' directly in the text -- it might have quotes
descriptions[name] = desc; descriptions[name] = desc;
return 'tabIndex="4" id="'+name+'_pref"' return 'tabIndex="4" id="'+name+'_pref"'
+' onkeypress="hide_prefs(event);"' +' onkeypress="hide_prefs(event);"'
+' onchange="set_'+name+'(this); return true;"' +' onchange="set_'+name+'(this); return true;"'
+' onfocus="saved_status=status_line.innerHTML;' +' onfocus="saved_status=status_line.innerHTML;'
+'status_line.innerHTML=descriptions[\''+name+'\'];"' +'status_line.innerHTML=descriptions[\''+name+'\'];"'
+' onblur="if (saved_status) status_line.innerHTML=saved_status;"'; +' onblur="status_line.innerHTML = saved_status || \'\';"';
} }
function InitializeSearch() { function InitializeSearch() {