dmstr / yii2-json-editor

Yii2 wrapper for "json-editor/json-editor" (is a fork of "jdorn/json-editor").
BSD 2-Clause "Simplified" License
8 stars 9 forks source link

filefly/editor: image preview only for images #33

Closed handcode closed 1 year ago

handcode commented 1 year ago

Currently, the Filefly editor displays a preview image tag for each item, regardless of the file type.

https://github.com/dmstr/yii2-json-editor/blob/master/src/assets/editors/filefly.js#L131

This results in unnecessary loading of the file in the browser for all non-image file types. Especially for large files like videos this generates a lot of unnecessary traffic.

preview image tag should only be added for images (e.g. with file extension check)

handcode commented 1 year ago

fixed in #34