-
-
Notifications
You must be signed in to change notification settings - Fork 835
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removed jquery from components: - AvatarEditor - CommentPost - HeaderList - LogInButton - NotificationGrid - PostMeta - PostsPage - PostStream - ReplyPlaceholder - SignUpModal - WelcomeHero - ComposerState fix: wrong usage of select fix: incorrect selector syntax
- Loading branch information
Showing
19 changed files
with
160 additions
and
125 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export default function heightWithMargin(element: HTMLElement): number { | ||
const style = getComputedStyle(element); | ||
return element.getBoundingClientRect().height + parseInt(style.marginBottom, 10) + parseInt(style.marginTop, 10); | ||
} |
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,24 @@ | ||
/** | ||
* A utility function that waits for the scroll to end. | ||
* Due to lack of support from some browsers, this is a workaround for `scrollend` event. | ||
* | ||
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTo#behavior | ||
* @see https://caniuse.com/mdn-api_element_scrollend_event | ||
* @param container The container element to wait scroll end on. | ||
* @returns A promise that resolves when the scroll is ended. | ||
*/ | ||
export default function scrollEnd(container: HTMLElement): Promise<void> { | ||
let lastTop = container.scrollTop; | ||
|
||
return new Promise((resolve) => { | ||
const animFrame = () => { | ||
if (lastTop === container.scrollTop) { | ||
resolve(); | ||
} else { | ||
requestAnimationFrame(animFrame); | ||
lastTop = container.scrollTop; | ||
} | ||
}; | ||
requestAnimationFrame(animFrame); | ||
}); | ||
} |
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
Oops, something went wrong.