Skip to content

Commit aa5c9f7

Browse files
committed
Apply Airbnb React/JSX Style Guide method order
1 parent 2680bac commit aa5c9f7

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/TableScrollbar.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,22 @@ export default class TableScrollbar extends React.Component {
4343
this.renderFixedHeader();
4444
}
4545

46+
handleScroll() {
47+
this.tableclone.style.top = this.container.scrollTop + "px";
48+
}
49+
50+
handleResize() {
51+
// Copy the columns width from the table to the clone.
52+
let columns = this.table.getElementsByTagName("th");
53+
let cloneColumns = this.tableclone.getElementsByTagName("th");
54+
for (let i = 0; i < columns.length; i++) {
55+
let width = columns[i].clientWidth + "px";
56+
cloneColumns[i].style.minWidth = width;
57+
cloneColumns[i].style.width = width;
58+
cloneColumns[i].style.boxSizing = "border-box";
59+
}
60+
}
61+
4662
renderFixedHeader() {
4763
// Remove previous table clone from the DOM.
4864
if (this.tableclone !== null) {
@@ -112,22 +128,6 @@ export default class TableScrollbar extends React.Component {
112128
</div>
113129
);
114130
}
115-
116-
handleScroll() {
117-
this.tableclone.style.top = this.container.scrollTop + "px";
118-
}
119-
120-
handleResize() {
121-
// Copy the columns width from the table to the clone.
122-
let columns = this.table.getElementsByTagName("th");
123-
let cloneColumns = this.tableclone.getElementsByTagName("th");
124-
for (let i = 0; i < columns.length; i++) {
125-
let width = columns[i].clientWidth + "px";
126-
cloneColumns[i].style.minWidth = width;
127-
cloneColumns[i].style.width = width;
128-
cloneColumns[i].style.boxSizing = "border-box";
129-
}
130-
}
131131
}
132132

133133
TableScrollbar.propTypes = propTypes;

0 commit comments

Comments
 (0)