Version 2.8.5

This commit is contained in:
Josh Johnson 2017-06-27 16:39:08 +01:00
parent 8485137121
commit 1eaceb1345
6 changed files with 31 additions and 18 deletions

View file

@ -1,4 +1,4 @@
/*! choices.js v2.8.4 | (c) 2017 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
/*! choices.js v2.8.5 | (c) 2017 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
@ -131,6 +131,7 @@ return /******/ (function(modules) { // webpackBootstrap
searchEnabled: true,
searchChoices: true,
searchFloor: 1,
searchResultLimit: 4,
searchFields: ['label', 'value'],
position: 'auto',
resetScrollPosition: true,
@ -417,19 +418,31 @@ return /******/ (function(modules) { // webpackBootstrap
// Create a fragment to store our list items (so we don't have to update the DOM for each item)
var choicesFragment = fragment || document.createDocumentFragment();
var filter = this.isSearching ? _utils.sortByScore : this.config.sortFilter;
var appendChoice = function appendChoice(choice) {
var dropdownItem = _this3._getTemplate('choice', choice);
var shouldRender = _this3.passedElement.type === 'select-one' || !choice.selected;
if (shouldRender) {
choicesFragment.appendChild(dropdownItem);
}
};
// If sorting is enabled or the user is searching, filter choices
if (this.config.shouldSort || this.isSearching) {
choices.sort(filter);
}
choices.forEach(function (choice) {
var dropdownItem = _this3._getTemplate('choice', choice);
var shouldRender = _this3.passedElement.type === 'select-one' || !choice.selected;
if (shouldRender) {
choicesFragment.appendChild(dropdownItem);
if (this.isSearching) {
for (var i = 0; i < this.config.searchResultLimit; i++) {
var choice = choices[i];
if (choice) {
appendChoice(choice);
}
}
});
} else {
choices.forEach(function (choice) {
return appendChoice(choice);
});
}
return choicesFragment;
}
@ -5025,7 +5038,7 @@ return /******/ (function(modules) { // webpackBootstrap
groupId: action.groupId,
value: action.value,
label: action.label || action.value,
disabled: action.disabled,
disabled: action.disabled || false,
selected: false,
active: true,
score: 9999

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,6 @@
{
"name": "choices.js",
"version": "2.8.4",
"version": "2.8.5",
"description": "A vanilla JS customisable text input/select box plugin",
"main": [
"./assets/scripts/dist/choices.js",

View file

@ -15,7 +15,7 @@
<meta name="theme-color" content="#ffffff">
<!-- Ignore these -->
<link rel="stylesheet" href="assets/styles/css/base.min.css?version=2.8.4">
<link rel="stylesheet" href="assets/styles/css/base.min.css?version=2.8.5">
<!-- End ignore these -->
<!-- Optional includes -->
@ -23,8 +23,8 @@
<!-- End optional includes -->
<!-- Choices includes -->
<link rel="stylesheet" href="assets/styles/css/choices.min.css?version=2.8.4">
<script src="assets/scripts/dist/choices.min.js?version=2.8.4"></script>
<link rel="stylesheet" href="assets/styles/css/choices.min.css?version=2.8.5">
<script src="assets/scripts/dist/choices.min.js?version=2.8.5"></script>
<!-- End Choices includes -->
<!--[if lt IE 9]>

View file

@ -1,6 +1,6 @@
{
"name": "choices.js",
"version": "2.8.4",
"version": "2.8.5",
"description": "A vanilla JS customisable text input/select box plugin",
"main": "./assets/scripts/dist/choices.min.js",
"scripts": {