Skip to content

Instantly share code, notes, and snippets.

View volnei's full-sized avatar
😀

Volnei Munhoz volnei

😀
  • Brazil
  • 10:26 (UTC -03:00)
View GitHub Profile
@dead-claudia
dead-claudia / mithril-conditional-route.js
Last active October 3, 2016 22:59
Conditional routing for Mithril
;(function (mod) {
if (typeof module === "object" && module != null && module.exports) {
// Node
module.exports = mod
} else if (typeof define === "function" && define.amd) {
// AMD
define("mithril-configure", function () { return mod })
} else if (typeof exports === "object" && exports != null) {
// Other CommonJS
exports.init = mod
@idevwise
idevwise / focusLoopingUtil.js
Last active October 19, 2022 16:58
Utility to loop focus inside a DOM element
/**
* Selectors for all focusable elements
* @type {string}
*/
const FOCUSABLE_ELEMENT_SELECTORS = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, [tabindex="0"], [contenteditable]';
const KEY_CODE_MAP = {
TAB: 9
};