Sha256: c602a67dc64d62c7cd6e5e0342a5988537130d6558838bb0f9e3ef1358fa65b5
Contents?: true
Size: 890 Bytes
Versions: 34
Compression:
Stored size: 890 Bytes
Contents
/* eslint-disable no-prototype-builtins, no-restricted-syntax, no-param-reassign */ // require self ((exports) => { let callbacks = {}; exports.onpopstate = (event) => { // Ensure the event is caused by user action if (event.isTrusted) { for (let callbackId in callbacks) { if (callbacks.hasOwnProperty(callbackId)) { callbacks[callbackId](event.state); } } } }; const registerCallback = (callbackId, callback) => { callbacks[callbackId] = callback; }; const unregisterCallback = (callbackId) => { callbacks[callbackId] = null; } const pushState = (url, state = null) => { if (window.history) { window.history.pushState(state, null, url); } }; exports.Decidim = exports.Decidim || {}; exports.Decidim.History = { registerCallback, unregisterCallback, pushState }; })(window);
Version data entries
34 entries across 34 versions & 1 rubygems