X Tutup
Skip to content

Commit fe11ac7

Browse files
committed
Merge pull request twbs#13390 from twbs/ie10-viewport-bug
add IE10 viewport bug workaround to examples
2 parents 0e48cb2 + 448086f commit fe11ac7

File tree

24 files changed

+86
-14
lines changed

24 files changed

+86
-14
lines changed

docs/_includes/header.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
<!-- Documentation extras -->
2020
<link href="../assets/css/docs.min.css" rel="stylesheet">
2121
<!--[if lt IE 9]><script src="../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
22+
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
23+
<script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
2224

2325
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
2426
<!--[if lt IE 9]>

docs/assets/js/_src/application.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,6 @@
1414

1515
$(function () {
1616

17-
// IE10 viewport hack for Surface/desktop Windows 8 bug
18-
//
19-
// See Getting Started docs for more information
20-
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
21-
var msViewportStyle = document.createElement('style')
22-
msViewportStyle.appendChild(
23-
document.createTextNode(
24-
'@-ms-viewport{width:auto!important}'
25-
)
26-
)
27-
document.querySelector('head').appendChild(msViewportStyle)
28-
}
29-
30-
3117
var $window = $(window)
3218
var $body = $(document.body)
3319

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*!
2+
* IE10 viewport hack for Surface/desktop Windows 8 bug
3+
* Copyright 2014 Twitter, Inc.
4+
* Licensed under the Creative Commons Attribution 3.0 Unported License. For
5+
* details, see http://creativecommons.org/licenses/by/3.0/.
6+
*/
7+
8+
// See the Getting Started docs for more information:
9+
// http://getbootstrap.com/getting-started/#support-ie10-width
10+
11+
(function () {
12+
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
13+
var msViewportStyle = document.createElement('style')
14+
msViewportStyle.appendChild(
15+
document.createTextNode(
16+
'@-ms-viewport{width:auto!important}'
17+
)
18+
)
19+
document.querySelector('head').appendChild(msViewportStyle)
20+
}
21+
})();

docs/examples/blog/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
<!-- Just for debugging purposes. Don't actually copy this line! -->
2020
<!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
2121

22+
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
23+
<script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
24+
2225
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
2326
<!--[if lt IE 9]>
2427
<script src="https://oss.maxcdn.com/html5shiv/3.7.1/html5shiv.min.js"></script>

docs/examples/carousel/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
<!-- Just for debugging purposes. Don't actually copy this line! -->
1717
<!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
1818

19+
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
20+
<script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
21+
1922
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
2023
<!--[if lt IE 9]>
2124
<script src="https://oss.maxcdn.com/html5shiv/3.7.1/html5shiv.min.js"></script>

docs/examples/cover/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
<!-- Just for debugging purposes. Don't actually copy this line! -->
2020
<!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
2121

22+
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
23+
<script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
24+
2225
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
2326
<!--[if lt IE 9]>
2427
<script src="https://oss.maxcdn.com/html5shiv/3.7.1/html5shiv.min.js"></script>

docs/examples/dashboard/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
<!-- Just for debugging purposes. Don't actually copy this line! -->
2020
<!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
2121

22+
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
23+
<script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
24+
2225
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
2326
<!--[if lt IE 9]>
2427
<script src="https://oss.maxcdn.com/html5shiv/3.7.1/html5shiv.min.js"></script>

docs/examples/equal-height-columns/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
<!-- Just for debugging purposes. Don't actually copy this line! -->
2020
<!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
2121

22+
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
23+
<script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
24+
2225
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
2326
<!--[if lt IE 9]>
2427
<script src="https://oss.maxcdn.com/html5shiv/3.7.1/html5shiv.min.js"></script>

docs/examples/grid/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
<!-- Just for debugging purposes. Don't actually copy this line! -->
2020
<!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
2121

22+
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
23+
<script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
24+
2225
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
2326
<!--[if lt IE 9]>
2427
<script src="https://oss.maxcdn.com/html5shiv/3.7.1/html5shiv.min.js"></script>

docs/examples/jumbotron-narrow/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
<!-- Just for debugging purposes. Don't actually copy this line! -->
2020
<!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
2121

22+
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
23+
<script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
24+
2225
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
2326
<!--[if lt IE 9]>
2427
<script src="https://oss.maxcdn.com/html5shiv/3.7.1/html5shiv.min.js"></script>

0 commit comments

Comments
 (0)
X Tutup