From 189ce731e0abea068a62eedffddc299e197f6005 Mon Sep 17 00:00:00 2001 From: benji Date: Mon, 1 Feb 2016 19:21:21 +0100 Subject: [PATCH] Fix #7 --- Gemfile.lock | 2 +- app/assets/javascripts/application.js | 5 ++--- app/assets/stylesheets/application.css.scss | 2 +- app/views/transactions/_new.html.haml | 2 +- app/views/transactions/index.html.haml | 0 app/views/users/show.html.haml | 4 ++-- 6 files changed, 7 insertions(+), 8 deletions(-) delete mode 100644 app/views/transactions/index.html.haml diff --git a/Gemfile.lock b/Gemfile.lock index 1ad5311..0fe9c09 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -240,7 +240,7 @@ GEM sdoc (0.4.1) json (~> 1.7, >= 1.7.7) rdoc (~> 4.0) - select2-rails (3.5.9.3) + select2-rails (4.0.1) thor (~> 0.14) sexp_processor (4.6.0) simplecov (0.10.0) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index bc5f3f0..bc4b5a6 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -23,12 +23,11 @@ ready = function() { $.each($(".select2-selector"), function(index, val) { $(val).select2({ - width: 'resolve', + width: $(val).data('width'), placeholder: $(".select2-selector"), allowClear: true }); - } - ) + }) } $(document).ready(ready) diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index 62fec6d..1dd0534 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -14,9 +14,9 @@ *= require dataTables/extras/dataTables.responsive *= require dataTables/jquery.dataTables *= require select2 + *= require select2-bootstrap *= require_self *= require purecss - *= require select2-bootstrap */ @import "bootstrap-sprockets"; @import "bootstrap"; diff --git a/app/views/transactions/_new.html.haml b/app/views/transactions/_new.html.haml index 1df3aee..d702df6 100644 --- a/app/views/transactions/_new.html.haml +++ b/app/views/transactions/_new.html.haml @@ -7,7 +7,7 @@ = f.select :creditor, options_from_collection_for_select(User.all.order(:name), :name, :name), { include_blank: true }, - { class: 'select2-selector', size: 50, required: true, data: { placeholder: "Creditor" } } + { class: 'select2-selector', required: true, data: { placeholder: "Creditor", width: 150 } } = f.text_field :message, placeholder: "Message", size: 75, class: "form-control", required: true .input-group %span.input-group-addon diff --git a/app/views/transactions/index.html.haml b/app/views/transactions/index.html.haml deleted file mode 100644 index e69de29..0000000 diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index 3f9b130..7216372 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -42,12 +42,12 @@ .input-listen{ 'data-input-type': 'text', 'data-filter-name': 'Issuer' } = grouped_collection_select nil, nil, [User, Client], :all, :name, :name, :name, { include_blank: true }, - { data: { placeholder: "Filter on Issuer" }, class: "select2-selector form-control value-thing" } + { data: { placeholder: "Filter on Issuer", width: 265 }, class: "select2-selector form-control value-thing" } .col-md-4 .input-listen{ 'data-input-type': 'text', 'data-filter-name': 'Peer' } = select_tag nil, options_from_collection_for_select(User.all.order(:name), :name, :name), - include_blank: true, class: "select2-selector form-control value-thing", data: { placeholder: "Filter on Peer" } + include_blank: true, class: "select2-selector form-control value-thing", data: { placeholder: "Filter on Peer", width: 265 } .col-md-4 .input-listen{ 'data-input-type': 'text', 'data-filter-name': 'Message' } %input.live-updating.value-thing{type: 'text', placeholder: 'Filter on Message',