Skip to content

A free open source IT asset/license management system

WIP - trying to get select2 wired up for importer

Brady Wetherington5c97e45d00ab
diff --git a/resources/views/livewire/importer-file.blade.php b/resources/views/livewire/importer-file.blade.php
index 3218648fee..e2e3440fb4 100644
--- a/resources/views/livewire/importer-file.blade.php
+++ b/resources/views/livewire/importer-file.blade.php
@@ -10,7 +10,9 @@
</div>
<div class="col-md-7 col-xs-12">
- {{ Form::select('importType', $importTypes, 0 /* FIXME whats' the old value? */, ['placeholder' => '', 'wire:model' => 'importType', 'wire:change' => 'changeTypes']) }}
+ <span wire:ignore>
+ {{ Form::select('importType', $importTypes, 0 /* FIXME whats' the old value? */, ['class' => 'livewire-select2', 'placeholder' => '', 'data-livewire-model' => 'importType']) }}
+ </span>
{{-- <select2 :options="options.importTypes" v-model="options.importType" required> --}}
{{-- <option disabled value="0"></option> --}}
{{-- </select2> --}}
@@ -205,3 +207,15 @@
</tr>
{{-- </template> --}}
+<script>
+console.warn("Doodie doodie butt farts")
+$('.livewire-select2').select2();
+console.warn("Select2 has been activated within the livewire context (maybe?)")
+$('.livewire-select2').on('select2:select', function (event) {
+ console.log("select2 selected!!!!!!!!!!!")
+})
+$('.livewire-select2').on('change',function (event) {
+ console.warn("Original target is: "+event.target)
+ // find the data-livewire-model thing?
+})
+</script>
\ No newline at end of file
diff --git a/resources/views/livewire/importer.blade.php b/resources/views/livewire/importer.blade.php
index 8a2b3832e4..ccef721b26 100644
--- a/resources/views/livewire/importer.blade.php
+++ b/resources/views/livewire/importer.blade.php
@@ -2,7 +2,7 @@
{{-- <importer inline-template v-cloak> --}} {{-- like, this, here, that's a literal Vue directive --}}
<div class="row">
{{-- <alert v-show="alert.visible" :alert-type="alert.type" v-on:hide="alert.visible = false">@{{ alert.message }}</alert> --}}
-<template>
+<template> {{-- this is going to take some porting :/ --}}
<div class="box" v-if="errors">
<div class="box-body">
<div class="alert alert-warning">
@@ -45,27 +45,6 @@
</div>
@endif
-<script>
- fixme = {
- /*
- * The component's data.
- */
- props: ['alertType', 'title'],
-
- computed: {
- alertClassName() {
- return 'alert-' + this.alertType;
- }
- },
-
- methods: {
- hideEvent() {
- this.$emit('hide');
- }
- }
- }
-
-</script>
{{-- errors thing that's built-in maybe? --}}
{{-- <errors :errors="importErrors"></errors> --}}