Вопрос

I have the Fine-Uploader working great, however I am trying to shoe-horn the entire interface into a very narrow dialog, and need to adjust the length at which the file names have ellipsis added to their middle, in order to truncate them so they fit.

Currently the file names are being truncated, but only after they become very long. I cannot see where the length for the file name is being determined, and what mechanism is being used. Does not appear to be using the text-overflow: ellipsis css tag.

Thanks.

Это было полезно?

Решение

This has changed in newer versions of fine-uploader since the earlier answer here by @ray-nicholus. The CSS does now specify a text-overflow: ellipsis on the 'qq-upload-file' class, and the default formatFileName handling does not truncate or otherwise modify the filename.

So to prevent ellipse now, you need to modify width of qq-upload-file and/or override the CSS text-overflow: ellipsis attribute.

This is true for v5.11.9. I don't know when it changed exactly.

Другие советы

You are correct, text-overflow: ellipsis; is not used. Why? Because this, in my opinion, is not the correct solution for this problem . Using text-overflow: ellipsis; would result in a loss of the last n characters in the file name, which includes the extension. To many, or at least some users, the extensions may be important/useful. So, Fine Uploader uses some simple JavaScript to limit the length of the filename, still preserving the last bits of the name. The default behavior is provided as a function value to the formatFileName option. By default, it limits the filename to 33 chars, plus 3 ellipses separating the halves of the file name. You can override this option with your own logic.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top