Browse Source

REFA,MINOR: movement of helper functions into helperFun object

master
chris 3 days ago
parent
commit
430411ff7f
  1. 4
      src/componentAncestry/wrapperComponent.js
  2. 2
      src/context/extStore.js
  3. 17
      src/context/generalHelpers.js

4
src/componentAncestry/wrapperComponent.js

@ -35,10 +35,10 @@ class ElementWrapper {
* @param {map<string,string>} attr Specific already known attributes
*/
constructor(element, attr = {}) {
fillAttrsInContainerByCb(
helperFun.fillAttrsInContainerByCb(
attr,
element,
function cb(k, v, con) {
function (k, v, con) {
con.setAttribute(k, v);
}
);

2
src/context/extStore.js

@ -416,7 +416,7 @@ class ExtStorage {
case ESAggregation.INTERNALIZED:
default:
return function (ssd, orgElement) {
fillAttrsInContainerByCb(
helperFun.fillAttrsInContainerByCb(
ssd._definition,
orgElement,
(key, val, el) => { el.style[key] = val; }

17
src/context/generalHelpers.js

@ -62,7 +62,7 @@ class ObjectAccessObject {
/**
* @type {Map<string, Function>}
*
*/
const helperFun = {
/**
@ -83,6 +83,18 @@ const helperFun = {
return intoContainer;
},
/**
*
* @param {HTMLElement} element
* @returns {string}
*/
getHigherCompSelector: function (element) {
let dac = "data-autocompel";
let hcompel = element.closest('[data-compel-ishcompel="true"]');
return `[${dac}="${hcompel.getAttribute(dac)}"]`;
},
/**
*
* @param {string} selector
@ -131,7 +143,8 @@ const helperFun = {
},
/**
* @type {Map<string, Function>}
* Contains helperFun functions from the installed/loaded extensions
* (jpclwe-<extension-name>)
*/
extensions: {}
}
Loading…
Cancel
Save