Re adding the mustard test too :-)

master
Jason Mayes 2015-03-11 11:02:54 +00:00
parent 825b61ddac
commit 04b00eeaa1
1 changed files with 18 additions and 0 deletions

View File

@ -152,3 +152,21 @@ var componentHandler = (function() {
register: registerInternal
};
})();
window.addEventListener('load', function() {
'use strict';
/**
* Performs a "Cutting the mustard" test. If the browser supports the features
* tested, adds a wsk-js class to the <html> element. It then upgrades all WSK
* components requiring JavaScript.
*/
if ('classList' in document.createElement('div') && 'querySelector' in document &&
'addEventListener' in window && Array.prototype.forEach) {
document.documentElement.classList.add('wsk-js');
componentHandler.upgradeAllRegistered();
} else {
componentHandler.upgradeElement = componentHandler.register = function () { };
}
});