From 33713af201ff125880c7068af87a437958203783 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 17 May 2018 13:27:14 -0300 Subject: [PATCH] select2 con bootstrap4 --- app/assets/javascripts/application.js | 4 ++-- app/assets/javascripts/select2.js | 4 +++- app/assets/stylesheets/application.scss | 3 ++- package.json | 1 + yarn.lock | 4 ++++ 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 247dd59..611a77d 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -21,6 +21,6 @@ //= require bootstrap/dropdown //= require bootstrap-markdown/js/bootstrap-markdown //= require markdown-it/dist/markdown-it -//= require select2/dist/js/select2 -//= require table-dragger/dist/table-dragger.js +//= require select2/dist/js/select2.full.min +//= require table-dragger/dist/table-dragger.min //= require_tree . diff --git a/app/assets/javascripts/select2.js b/app/assets/javascripts/select2.js index 59f68b9..ff9832b 100644 --- a/app/assets/javascripts/select2.js +++ b/app/assets/javascripts/select2.js @@ -3,6 +3,8 @@ $(document).on('turbolinks:load', function() { tags: true, tokenSeparators: [','], allowClear: true, - placeholder: '' + placeholder: '', + theme: 'bootstrap', + containerCssClass: ':all:' }); }); diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 08335f4..335b76c 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -2,7 +2,8 @@ @import "bootstrap-markdown/css/bootstrap-markdown.min"; @import "font-awesome"; @import "select2/dist/css/select2"; -@import "dragula-with-animation/dist/dragula.css"; +@import "select2-bootstrap-theme/dist/select2-bootstrap.min"; +@import "dragula-with-animation/dist/dragula"; $footer-height: 60px; diff --git a/package.json b/package.json index a9dc485..8fffbf0 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "marked": "^0.3.12", "popper.js": "^1.12.9", "select2": "^4.0.6-rc.1", + "select2-bootstrap-theme": "https://github.com/angel-vladov/select2-bootstrap-theme", "table-dragger": "^1.0.2" } } diff --git a/yarn.lock b/yarn.lock index 13a49c4..5b14f8c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -133,6 +133,10 @@ rx@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/rx/-/rx-4.1.0.tgz#a5f13ff79ef3b740fe30aa803fb09f98805d4782" +"select2-bootstrap-theme@https://github.com/angel-vladov/select2-bootstrap-theme": + version "0.1.0-beta.10" + resolved "https://github.com/angel-vladov/select2-bootstrap-theme#4fb604838e79150161fc636dbeb3b3022c034cda" + select2@^4.0.6-rc.1: version "4.0.6-rc.1" resolved "https://registry.yarnpkg.com/select2/-/select2-4.0.6-rc.1.tgz#aa6c3038a7f0f2e91ffade38f0a21c15e1813276"