mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-27 00:25:06 +02:00
Move the check for responsive width above the calculations of width. This will prevent the calculated values changing the width for browsers which don't respect min-width
This commit is contained in:
Vendored
+5
-6
@@ -3866,15 +3866,14 @@
|
||||
cols = this.get_highest_occupied_cell().col;
|
||||
}
|
||||
|
||||
if(this.is_responsive()) {
|
||||
this.$el.css({'min-width': '100%', 'max-width': '100%'});
|
||||
return this;
|
||||
}
|
||||
|
||||
var max_cols = (this.options.autogrow_cols ? this.options.max_cols : this.cols);
|
||||
var max_cols = (this.options.autogrow_cols ? this.options.max_cols : this.cols);
|
||||
|
||||
cols = Math.min(max_cols, Math.max(cols, this.options.min_cols));
|
||||
this.container_width = ((cols + 1) * this.options.widget_margins[0]) + (cols * this.min_widget_width);
|
||||
if(this.is_responsive()) {
|
||||
this.$el.css({'min-width': '100%', 'max-width': '100%'});
|
||||
return this; //if we are responsive exit before setting the width of $el
|
||||
}
|
||||
this.$el.css('width', this.container_width);
|
||||
|
||||
return this;
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+5
-6
@@ -3866,15 +3866,14 @@
|
||||
cols = this.get_highest_occupied_cell().col;
|
||||
}
|
||||
|
||||
if(this.is_responsive()) {
|
||||
this.$el.css({'min-width': '100%', 'max-width': '100%'});
|
||||
return this;
|
||||
}
|
||||
|
||||
var max_cols = (this.options.autogrow_cols ? this.options.max_cols : this.cols);
|
||||
var max_cols = (this.options.autogrow_cols ? this.options.max_cols : this.cols);
|
||||
|
||||
cols = Math.min(max_cols, Math.max(cols, this.options.min_cols));
|
||||
this.container_width = ((cols + 1) * this.options.widget_margins[0]) + (cols * this.min_widget_width);
|
||||
if(this.is_responsive()) {
|
||||
this.$el.css({'min-width': '100%', 'max-width': '100%'});
|
||||
return this; //if we are responsive exit before setting the width of $el
|
||||
}
|
||||
this.$el.css('width', this.container_width);
|
||||
|
||||
return this;
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -3019,15 +3019,14 @@
|
||||
cols = this.get_highest_occupied_cell().col;
|
||||
}
|
||||
|
||||
if(this.is_responsive()) {
|
||||
this.$el.css({'min-width': '100%', 'max-width': '100%'});
|
||||
return this;
|
||||
}
|
||||
|
||||
var max_cols = (this.options.autogrow_cols ? this.options.max_cols : this.cols);
|
||||
var max_cols = (this.options.autogrow_cols ? this.options.max_cols : this.cols);
|
||||
|
||||
cols = Math.min(max_cols, Math.max(cols, this.options.min_cols));
|
||||
this.container_width = ((cols + 1) * this.options.widget_margins[0]) + (cols * this.min_widget_width);
|
||||
if(this.is_responsive()) {
|
||||
this.$el.css({'min-width': '100%', 'max-width': '100%'});
|
||||
return this; //if we are responsive exit before setting the width of $el
|
||||
}
|
||||
this.$el.css('width', this.container_width);
|
||||
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user