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

Warning is shown when keyboard is shown #1

Open
gkorland opened this issue Jun 8, 2016 · 7 comments
Open

Warning is shown when keyboard is shown #1

gkorland opened this issue Jun 8, 2016 · 7 comments

Comments

@gkorland
Copy link

gkorland commented Jun 8, 2016

When the keyboard is shown a warning that the site is in Landscape is wrongly shown.

screenshot_20160608-132045

@arscan
Copy link
Owner

arscan commented Jun 8, 2016

Ah, good point. I'm just checking to see if the window width (or maybe the document width?) is bigger than the height, which is pretty hacky and behaves incorrectly in this case. I wonder if there is a more robust manner of figuring out orientation now that devices have matured a bit. Thanks for reporting this. It might take me a few weeks before I'll have time to address this though, so if you are interested in putting together a fix I'd be thrilled to accept a PR.

@mkarya001
Copy link

Fixed that issue and its working perfect for me i have created a new variable

var windowint = window.innerWidth;

and modified checkOrientationChange();

`

function checkOrientationChange(){
    if(!isMobile && options.onlyMobile){
        if(!init){
            init = true;
            setVisibility(false);
            setBodyClass("hiding");
            options.onHide(); // run this exactly once if not mobile
        }
        return;
    }

    if(currentOrientation !== isPortrait()){
        if(windowint == window.innerWidth){
            currentOrientation = true;
        }else{
            currentOrientation = false;
        }
        
        orientationChanged();
    }
}

`

@mkarya001
Copy link

mkarya001 commented Nov 24, 2016

or quite simple approach is to modify isPortrait()

var windowint = window.innerWidth;

function isPortrait(){ return ( window.innerWidth < window.innerHeight || windowint == window.innerWidth); }

@Paran0idAndr0id
Copy link

@mkarya001

Would you mind posting a full version of your script? I'm not getting your changes to work.

@mkarya001
Copy link

@arscan
Copy link
Owner

arscan commented Nov 30, 2016

Could you fork this repo and create a pull request @mkarya001? That way I can merge in your fixes so that everyone will get the updates going forward. Thanks for your help!

@mkarya001
Copy link

@arscan sure

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

4 participants