mirror of
https://0xacab.org/sutty/sutty
synced 2025-01-19 14:03:39 +00:00
el containercssclass prevenia mostrar el dropdown en multiple:false
https://github.com/yourlabs/django-autocomplete-light/pull/1015
This commit is contained in:
parent
6350a33043
commit
9c06220f9b
3 changed files with 13 additions and 6 deletions
|
@ -1,11 +1,6 @@
|
||||||
$(document).on('turbolinks:load', function() {
|
$(document).on('turbolinks:load', function() {
|
||||||
$('.select2').select2({
|
$('.select2').select2({
|
||||||
tags: true,
|
|
||||||
tokenSeparators: [','],
|
|
||||||
allowClear: true,
|
|
||||||
placeholder: '',
|
|
||||||
theme: 'bootstrap',
|
theme: 'bootstrap',
|
||||||
containerCssClass: ':all:',
|
|
||||||
width: ''
|
width: ''
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -15,6 +15,16 @@ class Post
|
||||||
complex? ? contents.dig('value') : contents
|
complex? ? contents.dig('value') : contents
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def max
|
||||||
|
return 0 if simple?
|
||||||
|
contents.fetch('max', 0)
|
||||||
|
end
|
||||||
|
|
||||||
|
def min
|
||||||
|
return 0 if simple?
|
||||||
|
contents.fetch('min', 0)
|
||||||
|
end
|
||||||
|
|
||||||
def type
|
def type
|
||||||
return @type if @type
|
return @type if @type
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
multiple: template.multiple?,
|
multiple: template.multiple?,
|
||||||
required: template.required?,
|
required: template.required?,
|
||||||
data: { tags: template.open?,
|
data: { tags: template.open?,
|
||||||
placeholder: t('posts.select.placeholder')}}
|
placeholder: t('posts.select.placeholder'),
|
||||||
|
'allow-clear': template.multiple?,
|
||||||
|
'maximum-selection-length': template.max }}
|
||||||
- if template.open?
|
- if template.open?
|
||||||
%small.text-muted.form-text= t('posts.open')
|
%small.text-muted.form-text= t('posts.open')
|
||||||
|
|
Loading…
Reference in a new issue