Don't inject autosuggest bits where we dont need it

This commit is contained in:
Alexander Butenko 2010-06-30 09:51:54 -04:00 committed by Christian Dywan
parent d6addb595b
commit 896cc75f57
2 changed files with 6 additions and 2 deletions

View file

@ -296,6 +296,8 @@ FormSuggestions.prototype.requestSuggestions = function (oAutoSuggestControl /*:
function initSuggestions () {
var inputs = document.getElementsByTagName ("input");
if (inputs.length == 0)
return false;
for (i=0;i<inputs.length;i++)
{
@ -308,4 +310,5 @@ function initSuggestions () {
if (inputs[i].type == "text" && autocomplete != "off")
var smth = new AutoSuggestControl (inputs[i], new FormSuggestions (ename));
}
return true;
};

View file

@ -64,7 +64,8 @@ formhistory_prepare_js ()
"function () {"
" if (document.getElementById('formhistory'))"
" return;"
" initSuggestions ();"
" if (!initSuggestions ())"
" return;"
" var mystyle = document.createElement('style');"
" mystyle.setAttribute('type', 'text/css');"
" mystyle.setAttribute('id', 'formhistory');"