Browse Source

Add feature detection test for classList

pm2
Luke Childs 8 years ago
parent
commit
65f82a1801
  1. 7
      public/assets/enhancements.js

7
public/assets/enhancements.js

@ -33,11 +33,12 @@
&& div.firstChild.namespaceURI
) == 'http://www.w3.org/2000/svg';
})(),
querySelector: typeof document.querySelector === 'function'
querySelector: typeof document.querySelector === 'function',
classList: 'classList' in document.createElement('div')
};
// Check required features for favourite nodes
if(supports.localStorage && supports.inlineSVG && supports.querySelector) {
if(supports.localStorage && supports.inlineSVG && supports.querySelector && supports.classList) {
// Get heart SVG
var xhr = new XMLHttpRequest();
@ -91,6 +92,7 @@
}
// Add ios class to body on iOS devices
if(supports.classList) {
DOMReady(function() {
if(
/iPad|iPhone|iPod/.test(navigator.userAgent)
@ -100,5 +102,6 @@
document.body.classList.add('ios');
}
});
}
})();

Loading…
Cancel
Save