2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 03:00:54 +00:00

Add user setting for configuring table string length (#3715)

This commit is contained in:
Oliver
2022-09-24 13:00:12 +10:00
committed by GitHub
parent 5a08ef908d
commit a7e4d27d6d
3 changed files with 15 additions and 3 deletions

View File

@ -45,10 +45,11 @@ function deleteButton(url, text='{% trans "Delete" %}') {
*/
function shortenString(input_string, options={}) {
var max_length = options.max_length || 100;
// Maximum length can be provided via options argument, or via a user-configurable setting
var max_length = options.max_length || user_settings.TABLE_STRING_MAX_LENGTH;
if (input_string == null) {
return null;
if (!max_length || !input_string) {
return input_string;
}
input_string = input_string.toString();