Allow configuration of image max size
issue10618 review342811002
This commit is contained in:
1 parent
3665161418
commit
87aa5bba53
4 files changed
+3
-4
No files matched your search
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
+1
-1
@@ -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]
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user