Add preview from father, add new features

This commit is contained in:
Ludovic CANDELLIER
2021-04-11 00:36:41 +02:00
parent f781158e36
commit f5ca57fdf2
58 changed files with 1482 additions and 532 deletions

View File

@@ -0,0 +1,25 @@
@if(!defined('LOAD_SET_OPTIONS'))
@push('js')
<script>
function setOptions(selector,data,selected,all) {
// console.log(data);
console.log(selector);
var $el = $(selector);
$el.empty(); // remove old options
if (all) {
$el.append($("<option></option>").attr("value",'').text('{{ __("all") }}'));
}
$.each(data, function(key, name) {
if (key != null) {
if (key == selected) {
$el.append($("<option selected='selected'></option>").attr("value", key).text(name));
} else {
$el.append($("<option></option>").attr("value", key).text(name));
}
}
});
}
</script>
@endpush
@php(define('LOAD_SET_OPTIONS', true))
@endif