Sha256: 61aad90f12a5df84de9915b248677a81fe0b7cf38314e172c2d676a520ac9678
Contents?: true
Size: 1.4 KB
Versions: 523
Compression:
Stored size: 1.4 KB
Contents
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define('GOVUKFrontend', ['exports'], factory) : (factory((global.GOVUKFrontend = {}))); }(this, (function (exports) { 'use strict'; /** * TODO: Ideally this would be a NodeList.prototype.forEach polyfill * This seems to fail in IE8, requires more investigation. * See: https://github.com/imagitama/nodelist-foreach-polyfill */ function nodeListForEach (nodes, callback) { if (window.NodeList.prototype.forEach) { return nodes.forEach(callback) } for (var i = 0; i < nodes.length; i++) { callback.call(window, nodes[i], i, nodes); } } // Used to generate a unique string, allows multiple instances of the component without // Them conflicting with each other. // https://stackoverflow.com/a/8809472 function generateUniqueID () { var d = new Date().getTime(); if (typeof window.performance !== 'undefined' && typeof window.performance.now === 'function') { d += window.performance.now(); // use high-precision timer if available } return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { var r = (d + Math.random() * 16) % 16 | 0; d = Math.floor(d / 16); return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16) }) } exports.nodeListForEach = nodeListForEach; exports.generateUniqueID = generateUniqueID; })));
Version data entries
523 entries across 523 versions & 4 rubygems