diff --git a/src/common.js b/src/common.js index 7bfea82dae..f27e985a89 100644 --- a/src/common.js +++ b/src/common.js @@ -19,8 +19,6 @@ Sao.common.SELECTION_SINGLE = 2; Sao.common.SELECTION_MULTIPLE = 3; - Sao.common.BIG_IMAGE_SIZE = Math.pow(10, 6); - Sao.common.compare = function(arr1, arr2) { if (arr1.length != arr2.length) { return false; diff --git a/src/sao.js b/src/sao.js index 1a09c86c44..07c4332e91 100644 --- a/src/sao.js +++ b/src/sao.js @@ -308,6 +308,7 @@ var Sao = {}; Sao.config.calendar_colors = '#fff,#267f82'.split(','); Sao.config.graph_color = '#267f82'; Sao.config.bus_timeout = 10 * 60 * 1000; + Sao.config.image_max_size = Math.pow(10, 6); Sao.i18n = i18n(); Sao.i18n.setlang = function(lang) { diff --git a/src/view/form.js b/src/view/form.js index d7f95ed5a8..40a8b59c69 100644 --- a/src/view/form.js +++ b/src/view/form.js @@ -4164,7 +4164,7 @@ function eval_pyson(value){ value = record.field_get_client(this.field_name); } if (value) { - if (value > Sao.common.BIG_IMAGE_SIZE) { + if (value > Sao.config.image_max_size) { value = jQuery.when(null); } else { value = record.model.fields[this.field_name] diff --git a/src/view/tree.js b/src/view/tree.js index 99d03bebd0..57ec549d1a 100644 --- a/src/view/tree.js +++ b/src/view/tree.js @@ -2526,7 +2526,7 @@ var value = this.field.get_client(record); if (value) { - if (value > Sao.common.BIG_IMAGE_SIZE) { + if (value > Sao.config.image_max_size) { set_src(null); } else { this.field.get_data(record).done(set_src);