-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove jQuery, refactor tests to new style, various upgrades (#98)
- Loading branch information
1 parent
1155d71
commit 084c9d6
Showing
10 changed files
with
2,877 additions
and
1,874 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
/** | ||
* Replacement for jQuery $.height() | ||
* Borrowed with thanks from https://github.com/nefe/You-Dont-Need-jQuery#2.2 | ||
*/ | ||
export function getHeight(el) { | ||
let styles = window.getComputedStyle(el); | ||
let height = el.offsetHeight; | ||
let borderTopWidth = parseFloat(styles.borderTopWidth); | ||
let borderBottomWidth = parseFloat(styles.borderBottomWidth); | ||
let paddingTop = parseFloat(styles.paddingTop); | ||
let paddingBottom = parseFloat(styles.paddingBottom); | ||
return height - borderBottomWidth - borderTopWidth - paddingTop - paddingBottom; | ||
} | ||
/** | ||
* Replacement function for jQuery $.width() | ||
* Borrowed with thanks from https://github.com/nefe/You-Dont-Need-jQuery#2.2 | ||
*/ | ||
export function getWidth(el) { | ||
let styles = window.getComputedStyle(el); | ||
let width = el.offsetWidth; | ||
let borderLeftWidth = parseFloat(styles.borderLeftWidth); | ||
let borderRightWidth = parseFloat(styles.borderRightWidth); | ||
let paddingLeft = parseFloat(styles.paddingLeft); | ||
let paddingRight = parseFloat(styles.paddingRight); | ||
return width - borderLeftWidth - borderRightWidth - paddingRight - paddingLeft; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.