From 307881a0683aa454e204b2d830e3598a0357690b Mon Sep 17 00:00:00 2001 From: Josh Johnson Date: Sat, 3 Nov 2018 12:42:42 +0000 Subject: [PATCH] Update documentation --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index adeaa88..a64f5c2 100644 --- a/README.md +++ b/README.md @@ -530,23 +530,22 @@ classNames: { **Input types affected:** `text`, `select-one`, `select-multiple` -**Usage:** Function to run on template creation. Through this callback it is possible to provide custom templates for the various components of Choices (see terminology). For Choices to work with custom templates, it is important you maintain the various data attributes defined [here](https://github.com/jshjohnson/Choices/blob/67f29c286aa21d88847adfcd6304dc7d068dc01f/assets/scripts/src/choices.js#L1993-L2067). +**Usage:** Function to run on template creation. Through this callback it is possible to provide custom templates for the various components of Choices (see terminology). For Choices to work with custom templates, it is important you maintain the various data attributes defined [here](https://github.com/jshjohnson/Choices/blob/master/src/scripts/templates.js). **Example:** ```js const example = new Choices(element, { callbackOnCreateTemplates: function (template) { - var classNames = this.config.classNames; return { - item: (data) => { + item: (classNames, data) => { return template(`
${data.label}
`); }, - choice: (data) => { + choice: (classNames, data) => { return template(`
0 ? 'role="treeitem"' : 'role="option"'}> ${data.label}