modularcode / modular-admin-html

ModularAdmin - Free Dashboard Theme Built On Bootstrap 4 | HTML Version
https://modularcode.io/modular-admin-html/
Other
2.92k stars 817 forks source link

Window.onTop(X,Y) - Header and sidebar fixed #52

Open Caballerog opened 7 years ago

Caballerog commented 7 years ago

Hi!

I've a question about the template, I wish to do "window.onTop(0,0)" to move the scroll when the user change between pages but it doesn't work due to the page (layout container) are in the top (0,0).

This problem appear in all case studies (header and sidebar fixed and static). Any suggest?

Caballerog commented 7 years ago

The temporal solution which I've found is the following:

body {
    padding: 0;
    margin: 0;
    //height: 100%;
    min-height: 100%;
    font-family: 'Open Sans', sans-serif;
    color: $color-text;
    overflow-x: hidden;
}

.main-wrapper {
    width: 100%;
    position: absolute;
//  height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

I've commented height property, so, the scroll used is from window instead of content.

Could this provoked a major error in the future? Thanks!

modularcoder commented 7 years ago

Was just going to suggest something similar :)) One more option is to remove

        width: 100%;
    position: absolute;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;

from .main-wrapper class

I guess I've applied those rules to .main-wrapper, because the main scrollbar on the right was becoming overlapped by fixed header.

modularcoder commented 7 years ago

image

Caballerog commented 7 years ago

Hi @modularcoder,

you're right, the only difference that I've found is the scrollbar goes under the fixed header but now you could use plugins like (infinite-scroll) or scrollTo when change the route when you have a SPA in any framework or vanillaJS.

I think that it would be a bit loss in design which is so much good in the logic of you app. At the moment, I don't know another solution.

modularcoder commented 7 years ago

@Caballerog

Yep, this is something I'll think about in future V2 release. Thanks for opening this topic. Will leave this issue open for now.

Regards Gevorg