Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Portrait / landscape mode doesn't display the same article #413

Open
Nono-m0le opened this issue Jan 26, 2019 · 7 comments
Open

Portrait / landscape mode doesn't display the same article #413

Nono-m0le opened this issue Jan 26, 2019 · 7 comments

Comments

@Nono-m0le
Copy link
Contributor

Hi tontof,

Me again :D
I realized that when I turn my mobile on landscape mode (usually to see embedded video within an article), the article displayed isn't the same as the one I was reading in portrait mode.
I'm using android 7.0 with FF 64.0.2
It also work on only text article. Just flip your phone one way and back. You always have to scroll a bit to see the article you were reading.

@tontof
Copy link
Owner

tontof commented Jan 26, 2019

I can not test as I don't have a device with orientation change on hand
but something with this custom code should do the trick:

var stop = 0; var sh = 0; document.getElementById('main-container').onscroll = function(evt) { stop = evt.target.scrollTop; sh = document.getElementById('main-container').scrollHeight; }
window.onresize = function(evt) { document.getElementById('main-container').scroll({ top: document.getElementById('main-container').scrollHeight*(stop/sh) , behavior: 'smooth' })}

I've tested with onresize event but you may have to change with onorientationchange
https://developer.mozilla.org/en-US/docs/Web/API/Screen/onorientationchange
hope this help...

@Nono-m0le
Copy link
Contributor Author

Please explain me what to do like I'm 5 ^^

@tontof
Copy link
Owner

tontof commented Jan 26, 2019

Don't you have a custom js file already ?
If not just copy/paste the inc/script.js and add the custom lines above at the end of the script.js file to try

@tontof
Copy link
Owner

tontof commented Jan 26, 2019

create a inc directory and add the script.js file inside the inc directory

@Nono-m0le
Copy link
Contributor Author

Nono-m0le commented Jan 26, 2019

ok, like I'm 7 then :D
I tried .. (only had a user.css) unsuccessful :(

Not sure if I did something wrong ... but it also removed all my items :'(

@tontof
Copy link
Owner

tontof commented Jan 27, 2019

Ooops I guess you did something wrong as I don't think what I told you can remove your items...
Sorry for that.
Can you send me a link of your KrISS feed instance so that I can look if your modification seems to be OK

@Nono-m0le
Copy link
Contributor Author

Sent by email :-)

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

No branches or pull requests

2 participants