public/javascripts/ie10-viewport-bug-workaround.js   A
last analyzed

Complexity

Total Complexity 2
Complexity/F 2

Size

Lines of Code 12
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
wmc 2
c 1
b 0
f 0
nc 1
mnd 1
bc 2
fnc 1
dl 0
loc 12
rs 10
bpm 2
cpm 2
noi 1
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
  'use strict';
13
  if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
0 ignored issues
show
Bug introduced by
The variable navigator seems to be never declared. If this is a global, consider adding a /** global: navigator */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
14
    var msViewportStyle = document.createElement('style')
15
    msViewportStyle.appendChild(
16
      document.createTextNode(
17
        '@-ms-viewport{width:auto!important}'
18
      )
19
    )
20
    document.querySelector('head').appendChild(msViewportStyle)
21
  }
22
})();
23