Open jsonpreet opened 7 years ago
Hi,
I added elfinder iframe in bootstrap modal but now i have issue close modal when file is selected. I got error message
Error in `getFileCallback`. jQuery(...).modal.hide is not a function
I changed in code closing function
<script type="text/javascript"> $(document).ready(function () { var elf = $('#elfinder').elfinder({ // set your elFinder options here <?php if($locale){ ?> lang: '<?= $locale ?>', // locale <?php } ?> customData: { _token: '<?= csrf_token() ?>' }, url: '<?= route("elfinder.connector") ?>', // connector URL soundPath: '<?= asset($dir.'/sounds') ?>', dialog: {width: 900, modal: true, title: 'Select a file'}, resizable: false, commandsOptions: { getfile: { oncomplete: 'destroy' } }, getFileCallback: function (file) { window.parent.processSelectedFile(file.path, '<?= $input_id?>'); jQuery('#elfinderModal').modal.hide(); } }).elfinder('instance'); }); </script>
Try to change jQuery('#elfinderModal').modal.hide(); to parent.jQuery('#elfinderModal').modal.hide();
jQuery('#elfinderModal').modal.hide();
parent.jQuery('#elfinderModal').modal.hide();
Or use new window, its a good practice https://goo.gl/4YyP3J
Hi,
I added elfinder iframe in bootstrap modal but now i have issue close modal when file is selected. I got error message
I changed in code closing function