Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Wip sub header #268

Closed
wants to merge 54 commits into from
Closed

Wip sub header #268

wants to merge 54 commits into from

Conversation

rschmukler
Copy link
Contributor

This implements #216.

As per suggestion from @matsko, uses native position: sticky when possible, otherwise uses a javascript implementation using the new $materialSticky service.

A new directive material-sticky is also exposed, which uses the $materialSticky service.

This pull request also makes the material-subheader create a h2 for accessibility purposes as per @marcysutton's suggestion. Subsequently, it ups the h2 and h3 in material-list-item to h3 and h4 respectively.

Commit messages will be squashed when approved by the team. Figured it'd be easier to see how it was implemented with individual commits.

Would love suggestions from @ajoslin on ideas for testing $materialSticky service, or anyone else who has ideas.

Also does anyone have opinion on whether we want to document material-sticky directive / $materialSticky service for usage on the docs?

ThomasBurleson and others added 30 commits September 10, 2014 17:34
Correcting dates. This project is only from 2014.
This commit adds an implementation of the "divider" component which groups and separates content within lists and page layouts using strong visual and spatial distinctions. Demos and docs accompany the implementation.

Closes #194. Closes #250.
@rschmukler
Copy link
Contributor Author

This pull request got all sorts of weird when I rebased my changes on top of master...

@ajoslin
Copy link
Contributor

ajoslin commented Sep 15, 2014

@ryan can you try rebasing again? You accidentally force-pushed your old version of master up yesterday when doing some rebasing.

I force-pushed my newer version of master back over the one you pushed and all is well now.

If you rebase again it may all work correctly.

$el.css({position: browserStickySupport, top: '0px'});
}

var debouncedCheck = $container.data('$stickyCheck') || $$rAF.debounce(checkElements.bind(undefined, $container));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to use angular.bind(context, fn, args) here. Function.prototype.bind doesn't exist on android 2.x. Although we don't actually support android 2, I would rather have a way to gracefully show an error on 2.x devices rather than just have the app completely stop due to a simple error like this one.

@rschmukler rschmukler closed this Sep 15, 2014
@rschmukler rschmukler deleted the wip-sub-header branch September 15, 2014 16:59
(function findTargetElement() {
var scroll = $container.scrollTop();
for(var i = 0; i < orderedElements.length ; ++i) {
if(rect(orderedElements[i].children(0)).bottom > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the point of .children(0) here?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants