mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-09 22:39:39 +08:00
refactor: use document.documentMode to determine msie version
Closes #9398
This commit is contained in:
@@ -173,13 +173,10 @@ var /** holds major version number for IE or NaN for real browsers */
|
||||
uid = 0;
|
||||
|
||||
/**
|
||||
* IE 11 changed the format of the UserAgent string.
|
||||
* See http://msdn.microsoft.com/en-us/library/ms537503.aspx
|
||||
* documentMode is an IE-only property
|
||||
* http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx
|
||||
*/
|
||||
msie = int((/msie (\d+)/.exec(lowercase(navigator.userAgent)) || [])[1]);
|
||||
if (isNaN(msie)) {
|
||||
msie = int((/trident\/.*; rv:(\d+)/.exec(lowercase(navigator.userAgent)) || [])[1]);
|
||||
}
|
||||
msie = document.documentMode;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
(function() {
|
||||
var msie = parseInt((/msie (\d+)/.exec(navigator.userAgent.toLowerCase()) || [])[1], 10);
|
||||
/**
|
||||
* documentMode is an IE-only property
|
||||
* http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx
|
||||
*/
|
||||
msie = document.documentMode;
|
||||
|
||||
/**
|
||||
* Triggers a browser event. Attempts to choose the right event if one is
|
||||
|
||||
Reference in New Issue
Block a user