Replacing bootstrap dropdown with select2

This commit is contained in:
Tony Air 2019-08-12 15:50:01 +07:00
parent 5ec0892125
commit 39ee137467
2 changed files with 157 additions and 154 deletions

View File

@ -1,9 +1,10 @@
import $ from 'jquery';
import 'bootstrap-select/dist/js/bootstrap-select';
$.fn.selectpicker.Constructor.BootstrapVersion = '4';
//import 'bootstrap-select/dist/js/bootstrap-select';
//$.fn.selectpicker.Constructor.BootstrapVersion = '4';
import 'select2/dist/js/select2.js';
import 'jquery.inputmask/dist/jquery.inputmask.bundle';
import select2 from 'jquery.inputmask/dist/jquery.inputmask.bundle';
import Events from "../_events";
import SpinnerUI from './_ui.spinner';
@ -37,8 +38,13 @@ const FormBasics = (($) => {
const $selectFields = $element.find('select:not([readonly])');
const $radioOptions = $element.find('input[type="radio"]');
const separator = '::;::';
$selectFields.each((i, el) => {
const $el = $(el);
$el.select2();
});
/*const separator = '::;::';
$selectFields.each((i, el) => {
const $el = $(el);
const maxOptions = $el.data('max-options') || false;
@ -109,7 +115,7 @@ const FormBasics = (($) => {
$('.dropdown-menu a').on('click', (e) => {
$(e.currentTarget).parents('.dropdown-menu').removeClass('show');
});
});*/
// /FIX
$fields.each((e, el) => {

View File

@ -29,7 +29,6 @@
"bootstrap-confirmation2": "^4.1.0",
"bootstrap-datepicker": "^1.9.0",
"bootstrap-offcanvas": "^1.0.0",
"bootstrap-select": "^1.13.10",
"bootstrap-table": "^1.14.2",
"bootstrap-timepicker": "^0.5.2",
"core-util-is": "^1.0.2",
@ -52,6 +51,7 @@
"react-bootstrap4-form-validation": "^1.0.10",
"routie": "0.0.1",
"smooth-scroll": "^14.2.1",
"select2": "^4.0.8",
"webpack-cli": "^3.3.2",
"yarn": "^1.16.0"
},
@ -112,8 +112,7 @@
"block-no-empty": null,
"color-no-invalid-hex": true,
"comment-empty-line-before": [
"always",
{
"always", {
"ignore": [
"stylelint-commands",
"after-comment"
@ -122,8 +121,7 @@
],
"declaration-colon-space-after": "always",
"indentation": [
4,
{
4, {
"except": [
"value"
]
@ -131,8 +129,7 @@
],
"max-empty-lines": 2,
"rule-empty-line-before": [
"always",
{
"always", {
"except": [
"first-nested"
],