Skip to content

Commit

Permalink
Merge pull request #1019 from SlovakNationalGallery/WEBUMENIA-2089
Browse files Browse the repository at this point in the history
[item] fix script loading time
  • Loading branch information
rastislav-chynoransky authored Aug 19, 2024
2 parents d7954c5 + e2e16f1 commit 7b95aa7
Showing 1 changed file with 33 additions and 31 deletions.
64 changes: 33 additions & 31 deletions resources/views/items/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
{!! Form::select('tags[]', $tags, old('tags'), ['multiple' => 'multiple', 'id' => 'tags']) !!}
</div>
<div class="col-xs-2 pl-1">
<button type="button" id="addTagsToSelected" class="mt-1 btn btn-info btn-sm btn-outline">Pridať tagy</a>
<button type="button" id="addTagsToSelected" class="mt-1 btn btn-info btn-sm btn-outline">Pridať tagy</button>
</div>
</div>

Expand Down Expand Up @@ -148,36 +148,38 @@
{{-- script --}}
@section('script')
<script>
$('#deleteSelected').on('click', function(e){
var $form=$(this).closest('form');
e.preventDefault();
$('#confirm').modal({ })
.one('click', '#delete', function (e) {
$form.attr("action","{!! URL::to('item/destroySelected') !!}");
$form.trigger('submit');
});
});
$('#refreshSelected').on('click', function(e){
var $form=$(this).closest('form');
e.preventDefault();
$form.attr("action","{!! URL::to('item/refreshSelected') !!}");
$form.trigger('submit');
});
$('#addTagsToSelected').on('click', function(e){
e.preventDefault();
var $form = $(this).closest('form');
$form.attr("action", @js(route('item-tags.store')));
$form.trigger('submit');
});
$("#collection").selectize();
$("#tags").selectize({
plugins: ['remove_button'],
persist: false, // Throw away de-selected created items
create: true, // Allow creation of new items
$(function () {
$('#deleteSelected').on('click', function(e){
var $form=$(this).closest('form');
e.preventDefault();
$('#confirm').modal({ })
.one('click', '#delete', function (e) {
$form.attr("action","{!! URL::to('item/destroySelected') !!}");
$form.trigger('submit');
});
});
$('#refreshSelected').on('click', function(e){
var $form=$(this).closest('form');
e.preventDefault();
$form.attr("action","{!! URL::to('item/refreshSelected') !!}");
$form.trigger('submit');
});
$('#addTagsToSelected').on('click', function(e){
e.preventDefault();
var $form = $(this).closest('form');
$form.attr("action", @js(route('item-tags.store')));
$form.trigger('submit');
});
$("#collection").selectize();
$("#tags").selectize({
plugins: ['remove_button'],
persist: false, // Throw away de-selected created items
create: true, // Allow creation of new items
});
});
</script>
@stop

0 comments on commit 7b95aa7

Please sign in to comment.