Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !13405

Improve affix-bottom behavior when document height is dynamic

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/charlesbjohnson/affix-bottom-when-dynamic-height into master Apr 23, 2014
  • Overview 0
  • Commits 3
  • Pipelines 0
  • Changes 2

Created by: charlesbjohnson

Hi, again!

This builds off of #13392 to make it so that an affixed element that relies on a bottom offset behave normally when there are changes that cause the document height to fluctuate.

Before:

  • Preview
  • Code

After:

  • Preview
  • Code

Determining the affix state is bundled into a separate method for correctness and so that it's slightly easier to understand (you can find an outline of how I understood the logic in the README for one of my plunks). Also, an element whose affix is determined to be 'bottom' always has its offset set (instead of just bailing out when it has been determined that the affix hasn't changed). This is so that if the document height changes that the affix-bottom element ends up in the right place when the next checkPosition occurs.

Please check out the demo to get a sense of what I'm talking about. Change the document height with + and - and watch how the bottom affix toggles between affix and affix-bottom on master, but not on my branch. I've also checked how these changes affect the affix used in the bootstrap docs by building them locally and it all looks good on my end.

Thanks! Any feedback is appreciated. 😄

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/charlesbjohnson/affix-bottom-when-dynamic-height