Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Commit

Permalink
moved all code to one file
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarotero committed Jun 17, 2018
1 parent fa7b5b3 commit a54d07f
Show file tree
Hide file tree
Showing 6 changed files with 488 additions and 530 deletions.
2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

<label>
Your favorite color:
<input type="text" name="datalist" list="colors" id="input-datalist">
<input type="text" name="datalist" id="input-datalist">
</label>

<datalist id="colors">
Expand Down
10 changes: 5 additions & 5 deletions demo/script.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import Suggestions from '../src/suggestions.js';
import DatalistSource from '../src/datalist-source.js';
import { Suggestions, Source, AjaxSource } from '../src/suggestions.js';

const datalistInput = document.getElementById('input-datalist');

const suggestions = new Suggestions(
datalistInput,
new DatalistSource(datalistInput)
new AjaxSource('data.json', datalistInput.closest('fieldset'))
// Source.createFromElement(document.getElementById('colors'))
);

suggestions.on('select', function(value) {
console.log(this.query, value);
datalistInput.addEventListener('suggestion:choosen', e => {
console.log(e.detail);
});
68 changes: 0 additions & 68 deletions src/ajax-source.js

This file was deleted.

61 changes: 0 additions & 61 deletions src/datalist-source.js

This file was deleted.

Loading

0 comments on commit a54d07f

Please sign in to comment.