mirror of
				https://github.com/twbs/bootstrap.git
				synced 2022-11-09 12:25:43 -05:00 
			
		
		
		
	Merge pull request #13390 from twbs/ie10-viewport-bug
add IE10 viewport bug workaround to examples
This commit is contained in:
		
						commit
						fe11ac77a2
					
				
					 24 changed files with 86 additions and 14 deletions
				
			
		| 
						 | 
				
			
			@ -19,6 +19,8 @@
 | 
			
		|||
<!-- Documentation extras -->
 | 
			
		||||
<link href="../assets/css/docs.min.css" rel="stylesheet">
 | 
			
		||||
<!--[if lt IE 9]><script src="../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
 | 
			
		||||
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
 | 
			
		||||
<script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
 | 
			
		||||
 | 
			
		||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
 | 
			
		||||
<!--[if lt IE 9]>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,20 +14,6 @@
 | 
			
		|||
 | 
			
		||||
  $(function () {
 | 
			
		||||
 | 
			
		||||
    // IE10 viewport hack for Surface/desktop Windows 8 bug
 | 
			
		||||
    //
 | 
			
		||||
    // See Getting Started docs for more information
 | 
			
		||||
    if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
 | 
			
		||||
      var msViewportStyle = document.createElement('style')
 | 
			
		||||
      msViewportStyle.appendChild(
 | 
			
		||||
        document.createTextNode(
 | 
			
		||||
          '@-ms-viewport{width:auto!important}'
 | 
			
		||||
        )
 | 
			
		||||
      )
 | 
			
		||||
      document.querySelector('head').appendChild(msViewportStyle)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    var $window = $(window)
 | 
			
		||||
    var $body   = $(document.body)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										21
									
								
								docs/assets/js/ie10-viewport-bug-workaround.js
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								docs/assets/js/ie10-viewport-bug-workaround.js
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,21 @@
 | 
			
		|||
/*!
 | 
			
		||||
 * IE10 viewport hack for Surface/desktop Windows 8 bug
 | 
			
		||||
 * Copyright 2014 Twitter, Inc.
 | 
			
		||||
 * Licensed under the Creative Commons Attribution 3.0 Unported License. For
 | 
			
		||||
 * details, see http://creativecommons.org/licenses/by/3.0/.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
// See the Getting Started docs for more information:
 | 
			
		||||
// http://getbootstrap.com/getting-started/#support-ie10-width
 | 
			
		||||
 | 
			
		||||
(function () {
 | 
			
		||||
  if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
 | 
			
		||||
    var msViewportStyle = document.createElement('style')
 | 
			
		||||
    msViewportStyle.appendChild(
 | 
			
		||||
      document.createTextNode(
 | 
			
		||||
        '@-ms-viewport{width:auto!important}'
 | 
			
		||||
      )
 | 
			
		||||
    )
 | 
			
		||||
    document.querySelector('head').appendChild(msViewportStyle)
 | 
			
		||||
  }
 | 
			
		||||
})();
 | 
			
		||||
| 
						 | 
				
			
			@ -19,6 +19,9 @@
 | 
			
		|||
    <!-- Just for debugging purposes. Don't actually copy this line! -->
 | 
			
		||||
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
 | 
			
		||||
 | 
			
		||||
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
 | 
			
		||||
    <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
 | 
			
		||||
 | 
			
		||||
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
 | 
			
		||||
    <!--[if lt IE 9]>
 | 
			
		||||
      <script src="https://oss.maxcdn.com/html5shiv/3.7.1/html5shiv.min.js"></script>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -16,6 +16,9 @@
 | 
			
		|||
    <!-- Just for debugging purposes. Don't actually copy this line! -->
 | 
			
		||||
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
 | 
			
		||||
 | 
			
		||||
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
 | 
			
		||||
    <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
 | 
			
		||||
 | 
			
		||||
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
 | 
			
		||||
    <!--[if lt IE 9]>
 | 
			
		||||
      <script src="https://oss.maxcdn.com/html5shiv/3.7.1/html5shiv.min.js"></script>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,6 +19,9 @@
 | 
			
		|||
    <!-- Just for debugging purposes. Don't actually copy this line! -->
 | 
			
		||||
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
 | 
			
		||||
 | 
			
		||||
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
 | 
			
		||||
    <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
 | 
			
		||||
 | 
			
		||||
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
 | 
			
		||||
    <!--[if lt IE 9]>
 | 
			
		||||
      <script src="https://oss.maxcdn.com/html5shiv/3.7.1/html5shiv.min.js"></script>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,6 +19,9 @@
 | 
			
		|||
    <!-- Just for debugging purposes. Don't actually copy this line! -->
 | 
			
		||||
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
 | 
			
		||||
 | 
			
		||||
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
 | 
			
		||||
    <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
 | 
			
		||||
 | 
			
		||||
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
 | 
			
		||||
    <!--[if lt IE 9]>
 | 
			
		||||
      <script src="https://oss.maxcdn.com/html5shiv/3.7.1/html5shiv.min.js"></script>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,6 +19,9 @@
 | 
			
		|||
    <!-- Just for debugging purposes. Don't actually copy this line! -->
 | 
			
		||||
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
 | 
			
		||||
 | 
			
		||||
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
 | 
			
		||||
    <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
 | 
			
		||||
 | 
			
		||||
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
 | 
			
		||||
    <!--[if lt IE 9]>
 | 
			
		||||
      <script src="https://oss.maxcdn.com/html5shiv/3.7.1/html5shiv.min.js"></script>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,6 +19,9 @@
 | 
			
		|||
    <!-- Just for debugging purposes. Don't actually copy this line! -->
 | 
			
		||||
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
 | 
			
		||||
 | 
			
		||||
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
 | 
			
		||||
    <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
 | 
			
		||||
 | 
			
		||||
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
 | 
			
		||||
    <!--[if lt IE 9]>
 | 
			
		||||
      <script src="https://oss.maxcdn.com/html5shiv/3.7.1/html5shiv.min.js"></script>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,6 +19,9 @@
 | 
			
		|||
    <!-- Just for debugging purposes. Don't actually copy this line! -->
 | 
			
		||||
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
 | 
			
		||||
 | 
			
		||||
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
 | 
			
		||||
    <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
 | 
			
		||||
 | 
			
		||||
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
 | 
			
		||||
    <!--[if lt IE 9]>
 | 
			
		||||
      <script src="https://oss.maxcdn.com/html5shiv/3.7.1/html5shiv.min.js"></script>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,6 +19,9 @@
 | 
			
		|||
    <!-- Just for debugging purposes. Don't actually copy this line! -->
 | 
			
		||||
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
 | 
			
		||||
 | 
			
		||||
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
 | 
			
		||||
    <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
 | 
			
		||||
 | 
			
		||||
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
 | 
			
		||||
    <!--[if lt IE 9]>
 | 
			
		||||
      <script src="https://oss.maxcdn.com/html5shiv/3.7.1/html5shiv.min.js"></script>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,6 +19,9 @@
 | 
			
		|||
    <!-- Just for debugging purposes. Don't actually copy this line! -->
 | 
			
		||||
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
 | 
			
		||||
 | 
			
		||||
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
 | 
			
		||||
    <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
 | 
			
		||||
 | 
			
		||||
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
 | 
			
		||||
    <!--[if lt IE 9]>
 | 
			
		||||
      <script src="https://oss.maxcdn.com/html5shiv/3.7.1/html5shiv.min.js"></script>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,6 +19,9 @@
 | 
			
		|||
    <!-- Just for debugging purposes. Don't actually copy this line! -->
 | 
			
		||||
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
 | 
			
		||||
 | 
			
		||||
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
 | 
			
		||||
    <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
 | 
			
		||||
 | 
			
		||||
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
 | 
			
		||||
    <!--[if lt IE 9]>
 | 
			
		||||
      <script src="https://oss.maxcdn.com/html5shiv/3.7.1/html5shiv.min.js"></script>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,6 +19,9 @@
 | 
			
		|||
    <!-- Just for debugging purposes. Don't actually copy this line! -->
 | 
			
		||||
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
 | 
			
		||||
 | 
			
		||||
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
 | 
			
		||||
    <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
 | 
			
		||||
 | 
			
		||||
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
 | 
			
		||||
    <!--[if lt IE 9]>
 | 
			
		||||
      <script src="https://oss.maxcdn.com/html5shiv/3.7.1/html5shiv.min.js"></script>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,6 +19,9 @@
 | 
			
		|||
    <!-- Just for debugging purposes. Don't actually copy this line! -->
 | 
			
		||||
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
 | 
			
		||||
 | 
			
		||||
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
 | 
			
		||||
    <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
 | 
			
		||||
 | 
			
		||||
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
 | 
			
		||||
    <!--[if lt IE 9]>
 | 
			
		||||
      <script src="https://oss.maxcdn.com/html5shiv/3.7.1/html5shiv.min.js"></script>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -21,6 +21,9 @@
 | 
			
		|||
    <!-- Just for debugging purposes. Don't actually copy this line! -->
 | 
			
		||||
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
 | 
			
		||||
 | 
			
		||||
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
 | 
			
		||||
    <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
 | 
			
		||||
 | 
			
		||||
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
 | 
			
		||||
    <!--[if lt IE 9]>
 | 
			
		||||
      <script src="https://oss.maxcdn.com/html5shiv/3.7.1/html5shiv.min.js"></script>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,6 +19,9 @@
 | 
			
		|||
    <!-- Just for debugging purposes. Don't actually copy this line! -->
 | 
			
		||||
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
 | 
			
		||||
 | 
			
		||||
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
 | 
			
		||||
    <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
 | 
			
		||||
 | 
			
		||||
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
 | 
			
		||||
    <!--[if lt IE 9]>
 | 
			
		||||
      <script src="https://oss.maxcdn.com/html5shiv/3.7.1/html5shiv.min.js"></script>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,6 +19,9 @@
 | 
			
		|||
    <!-- Just for debugging purposes. Don't actually copy this line! -->
 | 
			
		||||
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
 | 
			
		||||
 | 
			
		||||
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
 | 
			
		||||
    <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
 | 
			
		||||
 | 
			
		||||
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
 | 
			
		||||
    <!--[if lt IE 9]>
 | 
			
		||||
      <script src="https://oss.maxcdn.com/html5shiv/3.7.1/html5shiv.min.js"></script>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,6 +19,9 @@
 | 
			
		|||
    <!-- Just for debugging purposes. Don't actually copy this line! -->
 | 
			
		||||
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
 | 
			
		||||
 | 
			
		||||
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
 | 
			
		||||
    <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
 | 
			
		||||
 | 
			
		||||
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
 | 
			
		||||
    <!--[if lt IE 9]>
 | 
			
		||||
      <script src="https://oss.maxcdn.com/html5shiv/3.7.1/html5shiv.min.js"></script>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,6 +19,9 @@
 | 
			
		|||
    <!-- Just for debugging purposes. Don't actually copy this line! -->
 | 
			
		||||
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
 | 
			
		||||
 | 
			
		||||
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
 | 
			
		||||
    <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
 | 
			
		||||
 | 
			
		||||
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
 | 
			
		||||
    <!--[if lt IE 9]>
 | 
			
		||||
      <script src="https://oss.maxcdn.com/html5shiv/3.7.1/html5shiv.min.js"></script>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,6 +19,9 @@
 | 
			
		|||
    <!-- Just for debugging purposes. Don't actually copy this line! -->
 | 
			
		||||
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
 | 
			
		||||
 | 
			
		||||
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
 | 
			
		||||
    <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
 | 
			
		||||
 | 
			
		||||
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
 | 
			
		||||
    <!--[if lt IE 9]>
 | 
			
		||||
      <script src="https://oss.maxcdn.com/html5shiv/3.7.1/html5shiv.min.js"></script>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,6 +19,9 @@
 | 
			
		|||
    <!-- Just for debugging purposes. Don't actually copy this line! -->
 | 
			
		||||
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
 | 
			
		||||
 | 
			
		||||
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
 | 
			
		||||
    <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
 | 
			
		||||
 | 
			
		||||
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
 | 
			
		||||
    <!--[if lt IE 9]>
 | 
			
		||||
      <script src="https://oss.maxcdn.com/html5shiv/3.7.1/html5shiv.min.js"></script>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -21,6 +21,9 @@
 | 
			
		|||
    <!-- Just for debugging purposes. Don't actually copy this line! -->
 | 
			
		||||
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
 | 
			
		||||
 | 
			
		||||
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
 | 
			
		||||
    <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
 | 
			
		||||
 | 
			
		||||
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
 | 
			
		||||
    <!--[if lt IE 9]>
 | 
			
		||||
      <script src="https://oss.maxcdn.com/html5shiv/3.7.1/html5shiv.min.js"></script>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,6 +19,9 @@
 | 
			
		|||
    <!-- Just for debugging purposes. Don't actually copy this line! -->
 | 
			
		||||
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
 | 
			
		||||
 | 
			
		||||
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
 | 
			
		||||
    <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
 | 
			
		||||
 | 
			
		||||
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
 | 
			
		||||
    <!--[if lt IE 9]>
 | 
			
		||||
      <script src="https://oss.maxcdn.com/html5shiv/3.7.1/html5shiv.min.js"></script>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue