Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion resources/views/components/attribute/values.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
@endforeach

@foreach(($x=$values->skip(config('pla.limit.values'))->filter()) as $key => $value)
<input type="text" class="d-none" name="{{ $o->name_lc }}[{{ $langtag }}][]" value="{{ $value }}">
<input type="text" @class(['d-none','no-edit'=>(! ($editable ?? FALSE) && ($o->dn))]) name="{{ $o->name_lc }}[{{ $langtag }}][]" value="{{ $value }}">
@endforeach

@if($x->count())
Expand Down
4 changes: 4 additions & 0 deletions resources/views/components/attribute/widget/options.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
});

$('#page-modal').on('hide.bs.modal',function() {
// Only handle the close if the member-manage modal was the one open
if (! $(this).find('select#destination').length)
return;

var updated = modal_update(modal_attr,attribute_values('destination','select','option'));

if (updated.length)
Expand Down
19 changes: 11 additions & 8 deletions resources/views/modals/member-manage.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,19 @@
});

var filter = _.debounce(function(filter) {
$('select#source option').each(function() {
var option = $(this).text().toLowerCase();
var select = $('select#source');

$(this).toggle(option.indexOf(filter) > -1);
});
// Restore options hidden by a previous filter run
select.append(select.data('filtered') || $());

$('select#destination option').each(function() {
var option = $(this).text().toLowerCase();
// Detach non-matching options - hiding <option> with CSS is not supported in all browsers
select.data('filtered',select.find('option').filter(function() {
return $(this).text().toLowerCase().indexOf(filter) === -1;
}).detach());

$(this).toggle(option.indexOf(filter) > -1);
});
// Keep the visible list sorted
select.append(select.find('option').detach().sort(function(a,b) {
return $(a).text().localeCompare($(b).text());
}));
}, 500);
</script>