1 |
|
2 |
|
3 | window.Dropzone = require('dropzone');
|
4 |
|
5 | require('./redactor.js');
|
6 | require('./images.js');
|
7 | require('./repeater.js');
|
8 | require('./iconpicker.js');
|
9 |
|
10 | require('./object-types.js');
|
11 |
|
12 |
|
13 | $(function() {
|
14 |
|
15 | $('.fa-caret-right').click(function() {
|
16 | const target = $(this).data('target');
|
17 | $(target).toggle();
|
18 | $(this).toggleClass('fa-caret-right');
|
19 | $(this).toggleClass('fa-caret-down');
|
20 | })
|
21 |
|
22 | $('select#page_type').change(function() {
|
23 | const page_type = $('select#page_type option:selected').val();
|
24 | window.location.href = `?page_type=${page_type}`;
|
25 | });
|
26 |
|
27 |
|
28 | const setFileInputLabel = function() {
|
29 | const files = $(this).prop('files')
|
30 | const label = $.map(files, val => val.name).join(', ');
|
31 | $(this).next('.custom-file-label').text(label);
|
32 | };
|
33 | $('.custom-file-input').on('change', setFileInputLabel);
|
34 |
|
35 | $('.iconpicker').iconpicker({});
|
36 |
|
37 | });
|