modular-admin-html icon indicating copy to clipboard operation
modular-admin-html copied to clipboard

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

Open Caballerog opened this issue 7 years ago • 5 comments

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 avatar Jun 06 '17 13:06 Caballerog

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!

Caballerog avatar Jun 06 '17 15:06 Caballerog

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 avatar Jun 07 '17 06:06 modularcoder

image

modularcoder avatar Jun 07 '17 06:06 modularcoder

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.

Caballerog avatar Jun 07 '17 07:06 Caballerog

@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

modularcoder avatar Jun 07 '17 13:06 modularcoder