Skip to content

Commit

Permalink
Make empty behavior array a no-op.
Browse files Browse the repository at this point in the history
  • Loading branch information
hcayless committed Jul 11, 2022
1 parent 505d40e commit cf78f2b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 4 additions & 1 deletion src/CETEI.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,14 @@ childExists(elt, name) {
strings or an object with CSS selector keys and either functions
or arrays as described above. Returns a closure around a function
that can be called in the element constructor or applied to an
individual element.
individual element. An empty array is considered a no-op.
Called by the getHandler() and getFallback() methods
*/
decorator(template) {
if (Array.isArray(template) && template.length == 0) {
return function(e) {};
}
if (Array.isArray(template) && !Array.isArray(template[0])) {
return this.applyDecorator(template)
}
Expand Down
5 changes: 0 additions & 5 deletions src/defaultBehaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,6 @@ export default {
document.querySelector("head").appendChild(title);
}]
],
"cell": [
["[cols]", function(elt) {
elt.setAttribute("style", "grid-column: " + this.getOrdinality(elt) + " / span " + elt.getAttribute("cols") + ";");
}]
]
},
"teieg": {
"egXML": function(elt) {
Expand Down

0 comments on commit cf78f2b

Please sign in to comment.