mirror of
https://github.com/Choices-js/Choices.git
synced 2024-06-15 20:25:18 +02:00
Version 2.6.2
This commit is contained in:
parent
be03bc9212
commit
449baf2a0a
27
assets/scripts/dist/choices.js
vendored
27
assets/scripts/dist/choices.js
vendored
|
@ -1,4 +1,4 @@
|
|||
/*! choices.js v2.6.1 | (c) 2017 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
|
||||
/*! choices.js v2.6.2 | (c) 2017 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
|
||||
(function webpackUniversalModuleDefinition(root, factory) {
|
||||
if(typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = factory();
|
||||
|
@ -126,6 +126,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
search: true,
|
||||
searchFloor: 1,
|
||||
flip: true,
|
||||
resetScrollPosition: true,
|
||||
regexFilter: null,
|
||||
shouldSort: true,
|
||||
sortFilter: _utils.sortByAlpha,
|
||||
|
@ -484,8 +485,11 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
|
||||
// Clear choices
|
||||
this.choiceList.innerHTML = '';
|
||||
|
||||
// Scroll back to top of choices list
|
||||
if (this.config.resetScrollPosition) {
|
||||
this.choiceList.scrollTop = 0;
|
||||
}
|
||||
|
||||
// If we have grouped options
|
||||
if (activeGroups.length >= 1 && this.isSearching !== true) {
|
||||
|
@ -1520,6 +1524,8 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
var escapeKey = 27;
|
||||
var upKey = 38;
|
||||
var downKey = 40;
|
||||
var pageUpKey = 33;
|
||||
var pageDownKey = 34;
|
||||
var ctrlDownKey = e.ctrlKey || e.metaKey;
|
||||
|
||||
// If a user is typing and the dropdown is not active
|
||||
|
@ -1593,17 +1599,26 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
_this17.showDropdown(true);
|
||||
}
|
||||
|
||||
var currentEl = _this17.dropdown.querySelector('.' + _this17.config.classNames.highlightedState);
|
||||
var directionInt = e.keyCode === downKey ? 1 : -1;
|
||||
var nextEl = void 0;
|
||||
|
||||
_this17.canSearch = false;
|
||||
|
||||
var directionInt = e.keyCode === downKey || e.keyCode === pageDownKey ? 1 : -1;
|
||||
var skipKey = e.metaKey || e.keyCode === pageDownKey || e.keyCode === pageUpKey;
|
||||
|
||||
var nextEl = void 0;
|
||||
if (skipKey) {
|
||||
if (directionInt > 0) {
|
||||
nextEl = Array.from(_this17.dropdown.querySelectorAll('[data-choice-selectable]')).pop();
|
||||
} else {
|
||||
nextEl = _this17.dropdown.querySelector('[data-choice-selectable]');
|
||||
}
|
||||
} else {
|
||||
var currentEl = _this17.dropdown.querySelector('.' + _this17.config.classNames.highlightedState);
|
||||
if (currentEl) {
|
||||
nextEl = (0, _utils.getAdjacentEl)(currentEl, '[data-choice-selectable]', directionInt);
|
||||
} else {
|
||||
nextEl = _this17.dropdown.querySelector('[data-choice-selectable]');
|
||||
}
|
||||
}
|
||||
|
||||
if (nextEl) {
|
||||
// We prevent default to stop the cursor moving
|
||||
|
@ -1629,7 +1644,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
};
|
||||
|
||||
// Map keys to key actions
|
||||
var keyDownActions = (_keyDownActions = {}, _defineProperty(_keyDownActions, aKey, onAKey), _defineProperty(_keyDownActions, enterKey, onEnterKey), _defineProperty(_keyDownActions, escapeKey, onEscapeKey), _defineProperty(_keyDownActions, upKey, onDirectionKey), _defineProperty(_keyDownActions, downKey, onDirectionKey), _defineProperty(_keyDownActions, deleteKey, onDeleteKey), _defineProperty(_keyDownActions, backKey, onDeleteKey), _keyDownActions);
|
||||
var keyDownActions = (_keyDownActions = {}, _defineProperty(_keyDownActions, aKey, onAKey), _defineProperty(_keyDownActions, enterKey, onEnterKey), _defineProperty(_keyDownActions, escapeKey, onEscapeKey), _defineProperty(_keyDownActions, upKey, onDirectionKey), _defineProperty(_keyDownActions, pageUpKey, onDirectionKey), _defineProperty(_keyDownActions, downKey, onDirectionKey), _defineProperty(_keyDownActions, pageDownKey, onDirectionKey), _defineProperty(_keyDownActions, deleteKey, onDeleteKey), _defineProperty(_keyDownActions, backKey, onDeleteKey), _keyDownActions);
|
||||
|
||||
// If keycode has a function, run it
|
||||
if (keyDownActions[e.keyCode]) {
|
||||
|
|
2
assets/scripts/dist/choices.js.map
vendored
2
assets/scripts/dist/choices.js.map
vendored
File diff suppressed because one or more lines are too long
6
assets/scripts/dist/choices.min.js
vendored
6
assets/scripts/dist/choices.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "choices.js",
|
||||
"version": "2.6.1",
|
||||
"version": "2.6.2",
|
||||
"description": "A vanilla JS customisable text input/select box plugin",
|
||||
"main": [
|
||||
"./assets/scripts/dist/choices.js",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "choices.js",
|
||||
"version": "2.6.1",
|
||||
"version": "2.6.2",
|
||||
"description": "A vanilla JS customisable text input/select box plugin",
|
||||
"main": "./assets/scripts/dist/choices.min.js",
|
||||
"scripts": {
|
||||
|
|
Loading…
Reference in a new issue