How to use the modernizr.dataset function in modernizr

To help you get started, we’ve selected a few modernizr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github department-of-veterans-affairs / vets-website / _webpack / public / fake-entry.js View on Github external
// Get our browser up to date with polyfills.
const Modernizr = require('modernizr');
if (!Modernizr.classlist) {
  require('classlist-polyfill'); // DOM element classList support.
}
if (!Modernizr.dataset) {
  require('dataset');  // dataSet accessor support.
}

// This polyfill has its own test logic so no need to conditionally require.
require('polyfill-function-prototype-bind');

// Bring in foundation and custom libraries.
require('foundation/js/foundation/foundation');
github department-of-veterans-affairs / vets-website / assets / js / entry.js View on Github external
// Add all the ES6 library features that my be missing.
require('babel-polyfill');

// Get our browser up to date with polyfills.
const Modernizr = require('modernizr');
if (!Modernizr.classlist) {
  require('classlist-polyfill'); // DOM element classList support.
}
if (!Modernizr.dataset) {
  require('dataset');  // dataSet accessor support.
}

// This polyfill has its own test logic so no need to conditionally require.
require('polyfill-function-prototype-bind');

// Bring in foundation and custom libraries.
require('foundation/js/foundation/foundation');
require('./components.js');

// Things that run on document.ready().
require('./vendor/jquery-accessible-simple-tooltip-aria.js'); // Only used in facility-locator index and some playbook examples.
require('./vendor/menu.js');
require('./toggle-veterans-crisis-line.js');
github department-of-veterans-affairs / vets-website / src / js / client.js View on Github external
// This must occur before any react code is loaded.
if (window.parent !== window) {
  window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__;
}

require('../sass/style.scss');

// Get our browser up to date with polyfills.
// TODO(awong): These do NOT correctly conditionally load the polyfill.
// The polyfill is always loaded. require.ensure() should be used instead but
// then load ordering needs to be worked out. Fix later.
const Modernizr = require('modernizr');
if (!Modernizr.classlist) {
  require('classlist-polyfill'); // DOM element classList support.
}
if (!Modernizr.dataset) {
  require('dataset');  // dataSet accessor support.
}

// This polyfill has its own test logic so no need to conditionally require.
require('polyfill-function-prototype-bind');

// Bring in foundation and custom libraries.
require('foundation-sites');
require('./legacy/components.js');

// Only used in facility-locator index and some playbook examples.
require('jquery-accessible-simple-tooltip-aria/jquery-accessible-simple-tooltip-aria.js');
require('./legacy/menu.js');
require('./legacy/toggle-veterans-crisis-line.js');

// TODO(awong): Change this entry to something with a global router.