update app type via dropdown

This commit is contained in:
Kode 2018-11-04 16:03:55 +00:00
parent b30f1730e4
commit d321af6085
3 changed files with 23 additions and 14 deletions

View file

@ -1,4 +1,4 @@
{
"/css/app.css": "/css/app.css?id=286d5fcf1350566c1475",
"/js/app.js": "/js/app.js?id=0db2e72b5cd42d83e306"
}
"/css/app.css": "/css/app.css?id=fb2cfb67b5f04db8beee",
"/js/app.js": "/js/app.js?id=8dc4a6ea723d0df7469d"
}

View file

@ -27,7 +27,7 @@
</div>
<div class="input">
<label>{{ __('app.apps.apptype') }} *</label>
{!! Form::select('class', App\Application::applist(), null, array('class' => 'form-control config-item', 'data-config' => 'type')) !!}
{!! Form::select('class', App\Application::applist(), null, array('class' => 'form-control config-item', 'id' => 'apptype', 'data-config' => 'type')) !!}
</div>
<div class="input">

View file

@ -22,7 +22,24 @@
$( "#appname" ).autocomplete({
source: availableTags,
select: function( event, ui ) {
$.post('{{ route('appload') }}', { app: ui.item.value }, function(data) {
var appvalue = ui.item.value;
appload(appvalue);
}
});
$('#appname').on('keyup change', function(e) {
$('#tile-preview .title').html($(this).val());
})
$('#apptype').on('change', function(e) {
appload($(this).find('option:selected').text());
});
$('#appcolour').on('change', function(e) {
$('#tile-preview .item').css('backgroundColor', $(this).val());
})
$('.tags').select2();
function appload(appvalue) {
$.post('{{ route('appload') }}', { app: appvalue }, function(data) {
// Main details
$('#appimage').html("<img src='"+data.iconview+"' /><input type='hidden' name='icon' value='"+data.icon+"' />");
$('input[name=colour]').val(data.colour);
@ -38,16 +55,8 @@
});
}
}, "json");
}
});
$('#appname').on('keyup change', function(e) {
$('#tile-preview .title').html($(this).val());
})
$('#appcolour').on('change', function(e) {
$('#tile-preview .item').css('backgroundColor', $(this).val());
})
$('.tags').select2();
}
});
</script>