Skip to content

Commit 4936ef8

Browse files
author
David Morse
committed
fix: convert from JQury to DOM
Move from Jquery based width() for calculations to dom calls to avoid conflicts with webcomponents.js polyfills
1 parent 1812366 commit 4936ef8

7 files changed

+19
-19
lines changed

dist/jquery.gridster.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! gridster.js - v0.6.10 - 2015-06-04
1+
/*! gridster.js - v0.6.10 - 2015-06-08
22
* https://dsmorse.github.io/gridster.js/
33
* Copyright (c) 2015 ducksboard; Licensed MIT */
44

@@ -55,8 +55,8 @@
5555

5656
if (el && !update) {
5757
this.data = el.offset();
58-
this.data.width = el.width();
59-
this.data.height = el.height();
58+
this.data.width = el[0].scrollWidth;
59+
this.data.height = el[0].scrollHeight;
6060
}
6161

6262
if (el && update && !not_update_offsets) {
@@ -120,7 +120,7 @@
120120
return this.data('coords');
121121
}
122122

123-
var ins = new Coords(this, arguments[0]);
123+
var ins = new Coords(this);
124124
this.data('coords', ins);
125125
return ins;
126126
};
@@ -4562,7 +4562,7 @@
45624562
*/
45634563
fn.get_responsive_col_width = function () {
45644564
var cols = this.cols || this.options.max_cols;
4565-
return (this.$el.width() - ((cols + 1) * this.options.widget_margins[0])) / cols;
4565+
return (this.$el[0].scrollWidth - ((cols + 1) * this.options.widget_margins[0])) / cols;
45664566
};
45674567

45684568
/**

dist/jquery.gridster.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jquery.gridster.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jquery.gridster.with-extras.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! gridster.js - v0.6.10 - 2015-06-04
1+
/*! gridster.js - v0.6.10 - 2015-06-08
22
* https://dsmorse.github.io/gridster.js/
33
* Copyright (c) 2015 ducksboard; Licensed MIT */
44

@@ -55,8 +55,8 @@
5555

5656
if (el && !update) {
5757
this.data = el.offset();
58-
this.data.width = el.width();
59-
this.data.height = el.height();
58+
this.data.width = el[0].scrollWidth;
59+
this.data.height = el[0].scrollHeight;
6060
}
6161

6262
if (el && update && !not_update_offsets) {
@@ -120,7 +120,7 @@
120120
return this.data('coords');
121121
}
122122

123-
var ins = new Coords(this, arguments[0]);
123+
var ins = new Coords(this);
124124
this.data('coords', ins);
125125
return ins;
126126
};
@@ -4562,7 +4562,7 @@
45624562
*/
45634563
fn.get_responsive_col_width = function () {
45644564
var cols = this.cols || this.options.max_cols;
4565-
return (this.$el.width() - ((cols + 1) * this.options.widget_margins[0])) / cols;
4565+
return (this.$el[0].scrollWidth - ((cols + 1) * this.options.widget_margins[0])) / cols;
45664566
};
45674567

45684568
/**

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

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/jquery.coords.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959

6060
if (el && !update) {
6161
this.data = el.offset();
62-
this.data.width = el.width();
63-
this.data.height = el.height();
62+
this.data.width = el[0].scrollWidth;
63+
this.data.height = el[0].scrollHeight;
6464
}
6565

6666
if (el && update && !not_update_offsets) {
@@ -124,7 +124,7 @@
124124
return this.data('coords');
125125
}
126126

127-
var ins = new Coords(this, arguments[0]);
127+
var ins = new Coords(this);
128128
this.data('coords', ins);
129129
return ins;
130130
};

src/jquery.gridster.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3664,7 +3664,7 @@
36643664
*/
36653665
fn.get_responsive_col_width = function () {
36663666
var cols = this.cols || this.options.max_cols;
3667-
return (this.$el.width() - ((cols + 1) * this.options.widget_margins[0])) / cols;
3667+
return (this.$el[0].scrollWidth - ((cols + 1) * this.options.widget_margins[0])) / cols;
36683668
};
36693669

36703670
/**

0 commit comments

Comments
 (0)