}
return [
- 'options' => [
- 'style' => 'width: 250px; white-space: normal;', // уменьшаем ширину колонки
- ],
'attribute' => 'videoFiles',
'options' => [
'multiple' => false,
'showPreview' => true,
'showCaption' => true,
'showRemove' => true,
- 'showUpload' => false, // как у фото — не показываем кнопку загрузки
- 'browseClass' => 'btn btn-primary btn-sm', // кнопка как у фото (синий маленький btn)
- 'browseIcon' => '<i class="glyphicon glyphicon-plus"></i>',
- 'browseLabel' => 'Выбрать видео',
+ 'showUpload' => true,
'previewFileType' => 'video',
'allowedFileExtensions' => ['mp4', 'mov', 'avi'],
'maxFileSize' => 10240,
'initialPreview' => $initialPreview,
'initialPreviewAsData' => true,
'initialPreviewConfig' => $initialPreviewConfig,
+ // вот ключевые опции:
+ 'previewSettings' => [
+ 'video' => ['width' => '120px', 'height' => 'auto'],
+ ],
+ 'browseLabel' => '+',
+ 'removeLabel' => '-',
+ 'cancelLabel' => 'x',
+ 'layoutTemplates' => [
+ 'actions' => '<div class="file-actions">{remove} {upload} {cancel}</div>',
+ 'actionUpload' => '<button type="button" title="{uploadTitle}" class="kv-file-upload {uploadClass}" style="margin-left:5px">{uploadIcon}</button>',
+ 'actionRemove' => '<button type="button" title="{removeTitle}" class="kv-file-remove {removeClass}">{removeIcon}</button>',
+ 'actionCancel' => '<button type="button" title="{cancelTitle}" class="kv-file-cancel {cancelClass}">{cancelIcon}</button>',
+ ],
'fileActionSettings' => [
- 'showUpload' => false, // не показываем кнопку загрузки возле файла
- 'showZoom' => true,
+ 'showUpload' => true,
'showRemove' => true,
+ 'showZoom' => false,
+ 'showDrag' => false,
],
],
];