Skip to content

Commit aa8f4bf

Browse files
author
David Morse
committed
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
1 parent 16a7a65 commit aa8f4bf

File tree

7 files changed

+46
-44
lines changed

7 files changed

+46
-44
lines changed

dist/jquery.gridster.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
/*! gridster.js - v0.6.4 - 2015-03-19
2-
* http://gridster.net/
3-
* Copyright (c) 2015 decksterteam; Licensed */
4-
1+
/*! gridster.js - v0.6.4 - 2015-04-04
2+
* http://gridster.net/
3+
* Copyright (c) 2015 decksterteam; Licensed */
4+
55
.gridster {
66
position:relative;
77
}

dist/jquery.gridster.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
/*! gridster.js - v0.6.4 - 2015-03-19
2-
* http://gridster.net/
3-
* Copyright (c) 2015 decksterteam; Licensed */
4-
1+
/*! gridster.js - v0.6.4 - 2015-04-04
2+
* http://gridster.net/
3+
* Copyright (c) 2015 decksterteam; Licensed */
4+
55
;(function(root, factory) {
66

77
if (typeof define === 'function' && define.amd) {
@@ -119,7 +119,7 @@
119119
return Coords;
120120

121121
}));
122-
122+
123123
;(function(root, factory) {
124124

125125
if (typeof define === 'function' && define.amd) {
@@ -354,7 +354,7 @@
354354
return Collision;
355355

356356
}));
357-
357+
358358
;(function(window, undefined) {
359359

360360
/* Delay, debounce and throttle functions taken from underscore.js
@@ -427,7 +427,7 @@
427427
};
428428

429429
})(window);
430-
430+
431431
;(function(root, factory) {
432432

433433
if (typeof define === 'function' && define.amd) {
@@ -852,7 +852,7 @@
852852
return Draggable;
853853

854854
}));
855-
855+
856856
;(function(root, factory) {
857857

858858
if (typeof define === 'function' && define.amd) {
@@ -3866,17 +3866,17 @@
38663866
cols = this.get_highest_occupied_cell().col;
38673867
}
38683868

3869-
var max_cols = (this.options.autogrow_cols ? this.options.max_cols :
3870-
this.cols);
3869+
if(this.is_responsive()) {
3870+
this.$el.css({'min-width': '100%', 'max-width': '100%'});
3871+
return this;
3872+
}
3873+
3874+
var max_cols = (this.options.autogrow_cols ? this.options.max_cols : this.cols);
38713875

38723876
cols = Math.min(max_cols, Math.max(cols, this.options.min_cols));
38733877
this.container_width = ((cols + 1) * this.options.widget_margins[0]) + (cols * this.min_widget_width);
38743878
this.$el.css('width', this.container_width);
38753879

3876-
if(this.is_responsive()) {
3877-
this.$el.css({'min-width': '100%', 'max-width': '100%'});
3878-
return this;
3879-
}
38803880
return this;
38813881
};
38823882

dist/jquery.gridster.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jquery.gridster.min.js

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jquery.gridster.with-extras.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
/*! gridster.js - v0.6.4 - 2015-03-19
2-
* http://gridster.net/
3-
* Copyright (c) 2015 decksterteam; Licensed */
4-
1+
/*! gridster.js - v0.6.4 - 2015-04-04
2+
* http://gridster.net/
3+
* Copyright (c) 2015 decksterteam; Licensed */
4+
55
;(function(root, factory) {
66

77
if (typeof define === 'function' && define.amd) {
@@ -119,7 +119,7 @@
119119
return Coords;
120120

121121
}));
122-
122+
123123
;(function(root, factory) {
124124

125125
if (typeof define === 'function' && define.amd) {
@@ -354,7 +354,7 @@
354354
return Collision;
355355

356356
}));
357-
357+
358358
;(function(window, undefined) {
359359

360360
/* Delay, debounce and throttle functions taken from underscore.js
@@ -427,7 +427,7 @@
427427
};
428428

429429
})(window);
430-
430+
431431
;(function(root, factory) {
432432

433433
if (typeof define === 'function' && define.amd) {
@@ -852,7 +852,7 @@
852852
return Draggable;
853853

854854
}));
855-
855+
856856
;(function(root, factory) {
857857

858858
if (typeof define === 'function' && define.amd) {
@@ -3866,17 +3866,17 @@
38663866
cols = this.get_highest_occupied_cell().col;
38673867
}
38683868

3869-
var max_cols = (this.options.autogrow_cols ? this.options.max_cols :
3870-
this.cols);
3869+
if(this.is_responsive()) {
3870+
this.$el.css({'min-width': '100%', 'max-width': '100%'});
3871+
return this;
3872+
}
3873+
3874+
var max_cols = (this.options.autogrow_cols ? this.options.max_cols : this.cols);
38713875

38723876
cols = Math.min(max_cols, Math.max(cols, this.options.min_cols));
38733877
this.container_width = ((cols + 1) * this.options.widget_margins[0]) + (cols * this.min_widget_width);
38743878
this.$el.css('width', this.container_width);
38753879

3876-
if(this.is_responsive()) {
3877-
this.$el.css({'min-width': '100%', 'max-width': '100%'});
3878-
return this;
3879-
}
38803880
return this;
38813881
};
38823882

@@ -4363,7 +4363,7 @@
43634363
return Gridster;
43644364

43654365
}));
4366-
4366+
43674367
;(function(root, factory) {
43684368

43694369
if (typeof define === 'function' && define.amd) {

dist/jquery.gridster.with-extras.min.js

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/jquery.gridster.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3019,17 +3019,17 @@
30193019
cols = this.get_highest_occupied_cell().col;
30203020
}
30213021

3022-
var max_cols = (this.options.autogrow_cols ? this.options.max_cols :
3023-
this.cols);
3022+
if(this.is_responsive()) {
3023+
this.$el.css({'min-width': '100%', 'max-width': '100%'});
3024+
return this;
3025+
}
3026+
3027+
var max_cols = (this.options.autogrow_cols ? this.options.max_cols : this.cols);
30243028

30253029
cols = Math.min(max_cols, Math.max(cols, this.options.min_cols));
30263030
this.container_width = ((cols + 1) * this.options.widget_margins[0]) + (cols * this.min_widget_width);
30273031
this.$el.css('width', this.container_width);
30283032

3029-
if(this.is_responsive()) {
3030-
this.$el.css({'min-width': '100%', 'max-width': '100%'});
3031-
return this;
3032-
}
30333033
return this;
30343034
};
30353035

0 commit comments

Comments
 (0)