Fixes #11 Second Parameter to false will not add spacer li
This commit is contained in:
parent
2c117442af
commit
c201ff8f63
43
public/assets/scaffolding-min.js
vendored
43
public/assets/scaffolding-min.js
vendored
@ -108,7 +108,19 @@ const getURLVars = () => {
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
url: getURLVars(),
|
||||
url: (() => {
|
||||
var v = {};
|
||||
if (location.search.length > 0) {
|
||||
var qs = (location.search.substr(1)).split("&");
|
||||
for (var i = 0; i < qs.length; i++) {
|
||||
var t = qs[i].split("=");
|
||||
if (t[1].length > 0) {
|
||||
v[t[0]] = decodeURIComponent(t[1].replace(/\+/g, '%20'));
|
||||
}
|
||||
}
|
||||
}
|
||||
return v;
|
||||
})(),
|
||||
cookie: {
|
||||
set: (name, value, expires, path, domain, secure) => {
|
||||
switch(typeof expires) {
|
||||
@ -172,6 +184,9 @@ module.exports = {
|
||||
})
|
||||
}
|
||||
},
|
||||
// getCSS: (el, prop, b = false) {
|
||||
// return window.getComputedStyle(el, null).getPropertyValue(prop);
|
||||
// },
|
||||
init: (args = {}) => {
|
||||
const url = getURLVars();
|
||||
font.size = parseFloat(getComputedStyle(document.documentElement).fontSize.replace("px",""));
|
||||
@ -3187,11 +3202,17 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export */ init: function() { return /* binding */ init; }
|
||||
/* harmony export */ });
|
||||
/* DS2 core (c) 2024 Alexander McIlwraith
|
||||
import * as tabs from "../pg/patterns/layouts/tabs/_tabs.js";
|
||||
tabs.init();
|
||||
Released under Creative Commons Attribution-ShareAlike 4.0 International
|
||||
*/
|
||||
|
||||
function init(p = document) {
|
||||
// create a pure JS mouse click event
|
||||
const click = new MouseEvent('click', {
|
||||
view: window,
|
||||
bubbles: false,
|
||||
cancelable: true
|
||||
});
|
||||
|
||||
function init(p = document, s = true) {
|
||||
p.querySelectorAll(".tab-group, tabset").forEach(tabGroup => {
|
||||
|
||||
if (tabGroup.querySelector("[role=tablist]") === null) {
|
||||
@ -3218,7 +3239,7 @@ function init(p = document) {
|
||||
|
||||
const ul = document.createElement('ul');
|
||||
ul.setAttribute("role", "tablist");
|
||||
ul.innerHTML = `${tablist}<li role="separator" class="separator"></li>`;
|
||||
ul.innerHTML = s != true ? `${tablist}` : `${tablist}<li role="separator" class="separator"></li>`;
|
||||
tabGroup.insertBefore(ul, tabGroup.firstChild);
|
||||
|
||||
tabGroup.querySelectorAll('[role="tab"]').forEach(tab => {
|
||||
@ -3234,8 +3255,15 @@ function init(p = document) {
|
||||
const tabPanelId = tab.getAttribute("id").replace("tab", "tab-panel");
|
||||
document.getElementById(tabPanelId).classList.add("open");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
tab.addEventListener("keypress", (e) => {
|
||||
e.preventDefault();
|
||||
if( e.which == 32 || e.which == 13 ) {
|
||||
e.currentTarget.dispatchEvent(click);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -3371,9 +3399,6 @@ _core_core_js__WEBPACK_IMPORTED_MODULE_0__.init({
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
// deprecated switch handler
|
||||
const flipInfoSwitch = (e, s = e.currentTarget) => {
|
||||
|
||||
|
@ -159,11 +159,17 @@ $tab-notselected: #f0f0f0 !default;
|
||||
<pre class="language-js">import * as tabs from "./js/core/tabs/_tabs.js";
|
||||
tabs.init();</pre>
|
||||
<pre class="language-js">/* DS2 core (c) 2024 Alexander McIlwraith
|
||||
import * as tabs from "../pg/patterns/layouts/tabs/_tabs.js";
|
||||
tabs.init();
|
||||
Released under Creative Commons Attribution-ShareAlike 4.0 International
|
||||
*/
|
||||
|
||||
export function init(p = document) {
|
||||
// create a pure JS mouse click event
|
||||
const click = new MouseEvent('click', {
|
||||
view: window,
|
||||
bubbles: false,
|
||||
cancelable: true
|
||||
});
|
||||
|
||||
export function init(p = document, s = true) {
|
||||
p.querySelectorAll(".tab-group, tabset").forEach(tabGroup => {
|
||||
|
||||
if (tabGroup.querySelector("[role=tablist]") === null) {
|
||||
@ -190,7 +196,7 @@ export function init(p = document) {
|
||||
|
||||
const ul = document.createElement('ul');
|
||||
ul.setAttribute("role", "tablist");
|
||||
ul.innerHTML = `${tablist}<li role="separator" class="separator"></li>`;
|
||||
ul.innerHTML = s != true ? `${tablist}` : `${tablist}<li role="separator" class="separator"></li>`;
|
||||
tabGroup.insertBefore(ul, tabGroup.firstChild);
|
||||
|
||||
tabGroup.querySelectorAll('[role="tab"]').forEach(tab => {
|
||||
@ -206,8 +212,15 @@ export function init(p = document) {
|
||||
const tabPanelId = tab.getAttribute("id").replace("tab", "tab-panel");
|
||||
document.getElementById(tabPanelId).classList.add("open");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
tab.addEventListener("keypress", (e) => {
|
||||
e.preventDefault();
|
||||
if( e.which == 32 || e.which == 13 ) {
|
||||
e.currentTarget.dispatchEvent(click);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -178,9 +178,9 @@ module.exports = {
|
||||
})
|
||||
}
|
||||
},
|
||||
getCSS: (el, prop, b = false) {
|
||||
return window.getComputedStyle(el, null).getPropertyValue(prop);
|
||||
},
|
||||
// getCSS: (el, prop, b = false) {
|
||||
// return window.getComputedStyle(el, null).getPropertyValue(prop);
|
||||
// },
|
||||
init: (args = {}) => {
|
||||
const url = getURLVars();
|
||||
font.size = parseFloat(getComputedStyle(document.documentElement).fontSize.replace("px",""));
|
||||
|
@ -24,9 +24,6 @@ core.init({
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
// deprecated switch handler
|
||||
const flipInfoSwitch = (e, s = e.currentTarget) => {
|
||||
|
||||
|
@ -9,7 +9,7 @@ const click = new MouseEvent('click', {
|
||||
cancelable: true
|
||||
});
|
||||
|
||||
export function init(p = document) {
|
||||
export function init(p = document, s = true) {
|
||||
p.querySelectorAll(".tab-group, tabset").forEach(tabGroup => {
|
||||
|
||||
if (tabGroup.querySelector("[role=tablist]") === null) {
|
||||
@ -36,7 +36,7 @@ export function init(p = document) {
|
||||
|
||||
const ul = document.createElement('ul');
|
||||
ul.setAttribute("role", "tablist");
|
||||
ul.innerHTML = `${tablist}<li role="separator" class="separator"></li>`;
|
||||
ul.innerHTML = s != true ? `${tablist}` : `${tablist}<li role="separator" class="separator"></li>`;
|
||||
tabGroup.insertBefore(ul, tabGroup.firstChild);
|
||||
|
||||
tabGroup.querySelectorAll('[role="tab"]').forEach(tab => {
|
||||
|
Loading…
Reference in New Issue
Block a user