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

fix IE version detection in old IE #2653

Merged
merged 1 commit into from Sep 15, 2014

Conversation

SergioCrisostomo
Copy link
Member

Fixes #2652

@SergioCrisostomo SergioCrisostomo force-pushed the ie-version-fix branch 2 times, most recently from a9b2fd6 to 6824ee0 Compare Sep 14, 2014
@@ -46,7 +46,7 @@ var parse = function(ua, platform){
var Browser = this.Browser = parse(navigator.userAgent, navigator.platform);

if (Browser.name == 'ie'){
Browser.version = document.documentMode;
Browser.version = document.documentMode/*<ltIE8>*/ || parseFloat(navigator.appVersion.match(/MSIE ([\d.]+)/)[1])/*</ltIE8>*/;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't the Browser object at this point already contain the version? And in the case document.documentMode is available, it should that instead.

if (Browser.name == 'ie' && document.documentMode){
    Browser.version = document.documentMode;
}

@SergioCrisostomo
Copy link
Member Author

@arian that makes much more sense.
You are right, we had already the value from before and were writing-over with a undefined.

Updated the pull request.

if (Browser.name == 'ie'){
Browser.version = document.documentMode;
if (Browser.name == 'ie' && document.documentMode){
Browser.version = document.documentMode;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You changed the tab to 4 spaces...

@ibolmo ibolmo added the bug label Sep 15, 2014
@ibolmo ibolmo added this to the 1.5.2 milestone Sep 15, 2014
ibolmo added a commit that referenced this pull request Sep 15, 2014
@ibolmo ibolmo merged commit 09b99e5 into mootools:master Sep 15, 2014
@mootools mootools deleted a comment Feb 2, 2018
@mootools mootools deleted a comment Feb 3, 2020
@mootools mootools deleted a comment Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Browser.version reports undefined for IE 7 and below
3 participants