From d321af6085a13cc1314bff7f529b3f26eb0c223d Mon Sep 17 00:00:00 2001 From: Kode Date: Sun, 4 Nov 2018 16:03:55 +0000 Subject: [PATCH] update app type via dropdown --- public/mix-manifest.json | 6 ++--- resources/views/items/form.blade.php | 2 +- resources/views/items/scripts.blade.php | 29 ++++++++++++++++--------- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 0a42ffa3..295e59b2 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -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" +} \ No newline at end of file diff --git a/resources/views/items/form.blade.php b/resources/views/items/form.blade.php index 08493683..684cf23f 100644 --- a/resources/views/items/form.blade.php +++ b/resources/views/items/form.blade.php @@ -27,7 +27,7 @@
- {!! 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')) !!}
diff --git a/resources/views/items/scripts.blade.php b/resources/views/items/scripts.blade.php index d20e6c07..5d08d93a 100644 --- a/resources/views/items/scripts.blade.php +++ b/resources/views/items/scripts.blade.php @@ -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(""); $('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(); + } });