Merge pull request #15 from ZeusWPI/bug/7/select2html5

Fix #7
This commit is contained in:
benji 2016-02-01 19:25:38 +01:00
commit d128b2c1c0
6 changed files with 7 additions and 8 deletions

View file

@ -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)

View file

@ -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)

View file

@ -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";

View file

@ -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

View file

@ -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',