MDL-55417 forms: Keep the JS for autocomplete in the template
[moodle.git] / theme / noname / templates / core_form / element-autocomplete.mustache
index 75f93a1..de67eef 100644 (file)
             {{/element.options}}
         </select>
     {{/element}}
-{{/ core_form/element-template }}
\ No newline at end of file
+{{/ core_form/element-template }}
+{{#js}}
+require(['core/form-autocomplete'], function(module) {
+    module.enhance({{#quote}}#{{element.id}}{{/quote}},
+                   {{#quote}}{{element.tags}}{{/quote}},
+                   {{#quote}}{{element.ajax}}{{/quote}},
+                   {{#quote}}{{element.placeholder}}{{/quote}},
+                   {{#quote}}{{element.casesensitive}}{{/quote}},
+                   {{#quote}}{{element.showsuggestions}}{{/quote}},
+                   {{#quote}}{{element.noselectionstring}}{{/quote}});
+});
+{{/js}}