mirror of
https://github.com/bigchaindb/site.git
synced 2025-02-14 21:10:28 +01:00
proper select2 defaults, manual top 5 countries
This commit is contained in:
parent
f9af1e4259
commit
49ace24131
@ -47,11 +47,11 @@ var Forms = (function(w, d, $) {
|
||||
}
|
||||
},
|
||||
initSelect: function(el) {
|
||||
_config.form.find('select').select2({
|
||||
minimumResultsForSearch: 15,
|
||||
theme: 'bigchaindb',
|
||||
placeholder: '\xa0' // that's
|
||||
});
|
||||
$.fn.select2.defaults.set('minimumResultsForSearch', '15')
|
||||
$.fn.select2.defaults.set('theme', 'bigchaindb')
|
||||
$.fn.select2.defaults.set('placeholder', '\xa0') // that's
|
||||
|
||||
_config.form.find('select').select2();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -79,6 +79,7 @@
|
||||
|
||||
&[role=group] {
|
||||
padding: 0;
|
||||
border-bottom: 2px dashed $gray;
|
||||
}
|
||||
|
||||
&[aria-disabled=true] {
|
||||
@ -89,13 +90,18 @@
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.select2-results__group {
|
||||
padding: 6px;
|
||||
padding-bottom: 0;
|
||||
cursor: default;
|
||||
display: block;
|
||||
|
||||
&:empty { display: none; }
|
||||
}
|
||||
|
||||
.select2-results__option {
|
||||
padding-left: $spacer;
|
||||
|
||||
.select2-results__group {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.select2-results__option {
|
||||
margin-left: -$spacer;
|
||||
padding-left: $spacer * 2;
|
||||
@ -127,10 +133,4 @@
|
||||
background-color: $component-active-bg;
|
||||
color: $component-active-color;
|
||||
}
|
||||
|
||||
.select2-results__group {
|
||||
cursor: default;
|
||||
display: block;
|
||||
padding: 6px;
|
||||
}
|
||||
}
|
||||
|
@ -29,8 +29,19 @@
|
||||
<p class="form-group">
|
||||
<select class="form-control" id="country" name="country" required data-required="true">
|
||||
<option value=""> </option>
|
||||
<optgroup label="">
|
||||
<option value="US">United States</option>
|
||||
<option value="DE">Germany</option>
|
||||
<option value="IN">India</option>
|
||||
<option value="GB">United Kingdom</option>
|
||||
<option value="CN">China</option>
|
||||
</optgroup>
|
||||
<option value=""> </option>
|
||||
|
||||
{% for country in site.data.countries %}
|
||||
<option value="{{ country.cca2 }}">{{ country.name.common }}</option>
|
||||
{% unless country.cca2 == 'DE' or country.cca2 == 'US' or country.cca2 == 'IN' or country.cca2 == 'GB' or country.cca2 == 'CN' %}
|
||||
<option value="{{ country.cca2 }}">{{ country.name.common }}</option>
|
||||
{% endunless %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
<label class="form-label" for="country">Country</label>
|
||||
|
Loading…
x
Reference in New Issue
Block a user