110 } |
107 } |
111 |
108 |
112 // inject our HTML wrapper |
109 // inject our HTML wrapper |
113 var template = this.template.replace(new RegExp('--ID--', 'g'), element.id); |
110 var template = this.template.replace(new RegExp('--ID--', 'g'), element.id); |
114 var wrapper = element.parentNode; // document.createElement('div'); |
111 var wrapper = element.parentNode; // document.createElement('div'); |
115 wrapper.id = 'autofill_wrap_' + element.id; |
112 if ( !wrapper.id ) |
|
113 wrapper.id = 'autofill_wrap_' + element.id; |
116 |
114 |
117 // a bunch of hacks to add a spry wrapper |
115 // a bunch of hacks to add a spry wrapper |
118 wrapper.innerHTML = template + wrapper.innerHTML; |
116 wrapper.innerHTML = template + wrapper.innerHTML; |
119 |
117 |
120 var autosuggest = new Spry.Widget.AutoSuggest("autofill_wrap_" + element.id, element.id + '_region', window.autofill_ds_username, 'name', {loadFromServer: true, urlParam: 'userinput', hoverSuggestClass: 'row2', minCharsType: 3}); |
118 var autosuggest = new Spry.Widget.AutoSuggest(wrapper.id, element.id + '_region', window.autofill_ds_username, 'name', {loadFromServer: true, urlParam: 'userinput', hoverSuggestClass: 'row2', minCharsType: 3}); |
121 var regiondiv = document.getElementById(element.id + '_region'); |
119 var regiondiv = document.getElementById(element.id + '_region'); |
122 regiondiv.style.position = 'absolute'; |
120 regiondiv.style.position = 'absolute'; |
123 regiondiv.style.top = top + 'px'; |
121 regiondiv.style.top = top + 'px'; |
124 regiondiv.style.left = left + 'px'; |
122 regiondiv.style.left = left + 'px'; |
125 } |
123 } |