More UX and UI fixes

This commit is contained in:
James Brooks 2019-02-18 22:06:32 +00:00
parent 13e8b39892
commit 8d1bdf2a84
2 changed files with 11 additions and 8 deletions

View File

@ -216,7 +216,9 @@ $(function () {
$('input[name=remove_banner]').val('1');
});
$('.group-name').on('click', function () {
$('.group-name').on('click', function (event) {
event.stopPropagation();
var $this = $(this);
$this.find('.group-toggle').toggleClass('ion-ios-minus-outline').toggleClass('ion-ios-plus-outline');
@ -224,20 +226,16 @@ $(function () {
$this.next('.group-items').toggleClass('hide');
});
$('.select-group').on('click', function () {
$('.select-group').on('click', function (event) {
var $parentGroup = $(this).closest('ul.list-group');
$parentGroup.find('input[type=checkbox]').prop('checked', true);
$parentGroup.find('.group-items').removeClass('hide')
$parentGroup.find('.group-toggle').addClass('ion-ios-minus-outline').removeClass('ion-ios-plus-outline');
event.stopPropagation();
return false;
});
$('.deselect-group').on('click', function () {
$('.deselect-group').on('click', function (event) {
var $parentGroup = $(this).closest('ul.list-group');
$parentGroup.find('input[type=checkbox]').prop('checked', false);
$parentGroup.find('.group-items').addClass('hide');
$parentGroup.find('.group-toggle').removeClass('ion-ios-minus-outline').addClass('ion-ios-plus-outline');
event.stopPropagation();
return false;
});

View File

@ -41,9 +41,14 @@
@endforeach
@if($ungroupedComponents->isNotEmpty())
<ul class="list-group components">
<ul class="list-group">
<div class="list-group-item group-name">
<strong>{{ trans('cachet.components.group.other') }}</strong>
<div class="pull-right text-muted small">
<a href="javascript: void(0);" class="select-group" id="select-all-{{$componentGroup->id}}">{{ trans('cachet.components.select_all') }}</a>
&nbsp;|&nbsp;
<a href="javascript: void(0);" class="deselect-group" id="deselect-all-{{$componentGroup->id}}">{{ trans('cachet.components.deselect_all') }}</a>
</div>
</div>
@foreach($ungroupedComponents as $component)
@include('partials.component_input', compact($component))