From 00f812fb77bbd346326b0e94df0842a3e4f37084 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Tue, 20 Oct 2020 16:07:34 +0200 Subject: [PATCH] Enable select2 --- resources/assets/js/forms.js | 10 ++++++++++ resources/assets/themes/base.less | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/resources/assets/js/forms.js b/resources/assets/js/forms.js index ef81abbb..9f307d19 100644 --- a/resources/assets/js/forms.js +++ b/resources/assets/js/forms.js @@ -1,4 +1,5 @@ const moment = require('moment'); +require('select2') /** * Sets all checkboxes to the wanted state @@ -171,6 +172,15 @@ $(function () { }); }); +/** + * Enable select2 + */ +$(function () { + $.fn.select2.defaults.set('theme', 'bootstrap'); + + $('select').select2(); +}); + /** * Set the filter selects to latest state * diff --git a/resources/assets/themes/base.less b/resources/assets/themes/base.less index aac32b8f..43969962 100644 --- a/resources/assets/themes/base.less +++ b/resources/assets/themes/base.less @@ -1,5 +1,7 @@ @import "../../../node_modules/bootstrap/less/bootstrap"; @import "../../../node_modules/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css"; +@import "../../../node_modules/select2/dist/css/select2.min.css"; +@import "../../../node_modules/select2-bootstrap-theme/src/select2-bootstrap.less"; @import "error"; body { @@ -141,6 +143,10 @@ table a > .icon-icon_angel { background-color: @panel-danger-heading-bg; } +.select2-dropdown { + background-color: @brand-primary; +} + .selection .checkbox { display: block; }