From 57586c0e3df4b4f77f64b36c0116b5caaa9447f8 Mon Sep 17 00:00:00 2001 From: Josh Johnson Date: Mon, 26 Sep 2016 14:07:09 +0100 Subject: [PATCH] Update read me + minor tweak --- README.md | 8 ++++++++ assets/scripts/src/choices.js | 3 +-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c6abe20..beaa15e 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ A vanilla, lightweight (~15kb gzipped 🎉), configurable select box/text input loadingText: 'Loading...', noResultsText: 'No results round', noChoicesText: 'No choices to choose from', + itemSelectText: 'Press to select', classNames: { containerOuter: 'choices', containerInner: 'choices__inner', @@ -316,6 +317,13 @@ const example = new Choices(element, { **Usage:** The text that is shown when a user has selected all possible choices. +### itemSelectText +**Type:** `String` **Default:** `Press to select` + +**Input types affected:** `select-multiple`, `select-one` + +**Usage:** The text that is shown when a user hovers over a selectable choice. + ### classNames **Type:** `Object` **Default:** diff --git a/assets/scripts/src/choices.js b/assets/scripts/src/choices.js index c593e05..dc38de0 100644 --- a/assets/scripts/src/choices.js +++ b/assets/scripts/src/choices.js @@ -1703,7 +1703,6 @@ export default class Choices { * @private */ _createTemplates() { - const config = this.config; const classNames = this.config.classNames; const templates = { containerOuter: (direction) => { @@ -1767,7 +1766,7 @@ export default class Choices { choice: (data) => { return strToEl( ` -
0 ? 'role="treeitem"' : 'role="option"'}> +
0 ? 'role="treeitem"' : 'role="option"'}> ${data.label}
`