Skip to content

Commit b0b8be7

Browse files
committed
update standalone popup to accept extra elfinder options
1 parent cbd4bfe commit b0b8be7

4 files changed

Lines changed: 5 additions & 112 deletions

File tree

resources/views/ckeditor5.blade.php

Lines changed: 0 additions & 98 deletions
This file was deleted.

resources/views/common_scripts.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{-- jQuery (REQUIRED) --}}
22
@if (!isset ($jquery) || (isset($jquery) && $jquery == true))
3-
@basset('https://unpkg.com/jquery@3.6.4/dist/jquery.min.js')
3+
@basset('https://unpkg.com/jquery@3.6.1/dist/jquery.min.js')
44
@endif
55

66
{{-- jQuery UI and Smoothness theme --}}

resources/views/standalonepopup.blade.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
},
3232
url: '{{ route("elfinder.connector") }}', // connector URL
3333
soundPath: '{{ Basset::getUrl(base_path("vendor/studio-42/elfinder/sounds")) }}',
34-
dialog: {width: 900, modal: true, title: 'Select a file'},
3534
resizable: false,
3635
onlyMimes: @json(unserialize(urldecode(request('mimes'))), JSON_UNESCAPED_SLASHES),
3736
commandsOptions: {
@@ -40,20 +39,19 @@
4039
oncomplete: 'destroy'
4140
}
4241
},
43-
getFileCallback: function (file) {
42+
getFileCallback: (file) => {
4443
@if (request()->has('multiple') && request()->input('multiple') == 1)
4544
window.parent.processSelectedMultipleFiles(file, '{{ $input_id }}');
4645
@else
4746
window.parent.processSelectedFile(file.path, '{{ $input_id }}');
4847
@endif
49-
5048
window.parent.jQuery.colorbox.close();
5149
},
5250
};
51+
let elfinderOptions = window.parent.elfinderOptions ?? {};
52+
var elf = $('#elfinder').elfinder({...elfinderConfig, ...elfinderOptions}).elfinder('instance');
5353
54-
var elf = $('#elfinder').elfinder(elfinderConfig);
55-
document.getElementById('elfinder').style.opacity = 1;
56-
54+
document.getElementById('elfinder').style.opacity = 1;
5755
});
5856
</script>
5957
</head>

src/FileManagerServiceProvider.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@ public function boot(Router $router)
2424
if ($this->app->runningInConsole()) {
2525
$this->bootForConsole();
2626
}
27-
28-
$config = $this->app['config']->get('elfinder.route', []);
29-
$config['namespace'] = 'Backpack\FileManager\Http\Controllers';
30-
31-
$router->group($config, function ($router) {
32-
$router->get('ckeditor5', ['as' => 'elfinder.ckeditor5', 'uses' => 'BackpackElfinderController@showCKeditor5']);
33-
});
3427
}
3528

3629
/**

0 commit comments

Comments
 (0)