UNPKG

900 BJavaScriptView Raw
1
2
3window.Dropzone = require('dropzone');
4
5require('./redactor.js');
6require('./images.js');
7require('./repeater.js');
8require('./iconpicker.js');
9
10require('./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 // bootstrap custom file input
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});