@@ -16,18 +16,21 @@ class Uppy extends Component
16
16
17
17
public string $ extraJSForOnUploadSuccess ;
18
18
19
+ public string $ uploadElementClass ;
20
+
19
21
/**
20
22
* Create a new component instance.
21
23
*
22
24
* @return void
23
25
*/
24
- public function __construct (string $ options = '' , string $ statusBarOptions = '' , string $ dragDropOptions = '' , string $ hiddenField = '' , $ extraJSForOnUploadSuccess = '' )
26
+ public function __construct (string $ options = '' , string $ statusBarOptions = '' , string $ dragDropOptions = '' , string $ hiddenField = 'file ' , string $ extraJSForOnUploadSuccess = '' , string $ uploadElementClass = ' upload ' )
25
27
{
26
28
$ this ->options = $ options ;
27
29
$ this ->statusBarOptions = $ statusBarOptions ;
28
30
$ this ->dragDropOptions = $ dragDropOptions ;
29
31
$ this ->hiddenField = $ hiddenField ;
30
32
$ this ->extraJSForOnUploadSuccess = $ extraJSForOnUploadSuccess ;
33
+ $ this ->uploadElementClass = $ uploadElementClass ;
31
34
32
35
if (!$ options ) {
33
36
$ this ->options = '{
@@ -39,20 +42,16 @@ public function __construct(string $options = '', string $statusBarOptions = '',
39
42
40
43
if (!$ statusBarOptions ) {
41
44
$ this ->statusBarOptions = "{
42
- target: '.upload .for-ProgressBar',
45
+ target: '. { $ uploadElementClass } .for-ProgressBar',
43
46
hideAfterFinish: false,
44
47
} " ;
45
48
}
46
49
47
50
if (!$ dragDropOptions ) {
48
51
$ this ->dragDropOptions = "{
49
- target: '.upload .for-DragDrop',
52
+ target: '. { $ uploadElementClass } .for-DragDrop',
50
53
} " ;
51
54
}
52
-
53
- if (!$ hiddenField ) {
54
- $ this ->hiddenField = 'file ' ;
55
- }
56
55
}
57
56
58
57
/**
0 commit comments