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

Sticky projects #246

Merged
merged 1 commit into from
Mar 9, 2018
Merged

Sticky projects #246

merged 1 commit into from
Mar 9, 2018

Conversation

simurai
Copy link
Contributor

@simurai simurai commented Mar 9, 2018

@simurai simurai added this to the 1.26 milestone Mar 9, 2018
@simurai simurai merged commit aea87c2 into master Mar 9, 2018
@simurai simurai deleted the sm-sticky-projects branch March 9, 2018 10:57
@UziTech
Copy link
Contributor

UziTech commented Mar 19, 2018

This introduces an unintended side affect.

When the auto reveal setting is checked in tree-view and the file is under the sticky header it is not revealed

screenshot

@UziTech
Copy link
Contributor

UziTech commented Mar 19, 2018

it looks like the problem is that the tree-view's scrollToEntry function uses scrollIntoViewIfNeeded which doesn't make sure the element isn't hidden by the sticky header

  scrollToEntry: (entry, center=true) ->
    element = if entry?.classList.contains('directory') then entry.header else entry
    element?.scrollIntoViewIfNeeded(center)

@simurai
Copy link
Contributor Author

simurai commented Mar 27, 2018

Ohh.. I see, scrollIntoViewIfNeeded doesn't know anything about the sticky elements and thinks the revealed item is still visible.

There would be a CSS fix, found here:

.tree-view {
  // Fix sticky header from covering auto-revealed items
  .list-item.selected {
    padding-top: @ui-tab-height; // 30px
    margin-top: -@ui-tab-height; // -30px
  }
}

tree-view

I guess the negative margin tricks scrollIntoViewIfNeeded into thinking it's already out of view and the padding just pushes the content down. Not sure if that has other side effects? 🙈

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.

2 participants