Skip to content

Commit

Permalink
Merge pull request #50 from QuickCorp/v2.3
Browse files Browse the repository at this point in the history
improved performance on widgets
  • Loading branch information
jeanmachuca committed Apr 17, 2021
2 parents 8cd445a + b9b243c commit f05fbe2
Showing 1 changed file with 9 additions and 35 deletions.
44 changes: 9 additions & 35 deletions QCObjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -3163,44 +3163,18 @@
const componentWidget = this;
const componentName = componentWidget.nodeName.toLowerCase();
const componentBody = _DOMCreateElement("component");
const __enabled__atributes__ = ["shadowed","componentClass", "controllerClass", "viewClass", "serviceClass", "effectClass", "tplextension", "template-source", "data"];
componentBody.setAttribute("name",componentName);
if (componentWidget.hasAttribute("shadowed") && componentWidget.getAttribute("shadowed") === "false"){
componentBody.setAttribute("shadowed","false");
componentWidget.removeAttribute("shadowed");
} else {

if (!componentWidget.hasAttribute("shadowed")) {
componentBody.setAttribute("shadowed","true");
if (componentWidget.hasAttribute("shadowed")){
componentWidget.removeAttribute("shadowed");
}
}
if (componentWidget.hasAttribute("componentClass")){
componentBody.setAttribute("componentClass",componentWidget.getAttribute("componentClass"));
componentWidget.removeAttribute("componentClass");
}
if (componentWidget.hasAttribute("controllerClass")){
componentBody.setAttribute("controllerClass",componentWidget.getAttribute("controllerClass"));
componentWidget.removeAttribute("controllerClass");
}
if (componentWidget.hasAttribute("viewClass")){
componentBody.setAttribute("viewClass",componentWidget.getAttribute("viewClass"));
componentWidget.removeAttribute("viewClass");
}
if (componentWidget.hasAttribute("serviceClass")){
componentBody.setAttribute("serviceClass",componentWidget.getAttribute("serviceClass"));
componentWidget.removeAttribute("serviceClass");
}
if (componentWidget.hasAttribute("tplextension")){
componentBody.setAttribute("tplextension",componentWidget.getAttribute("tplextension"));
componentWidget.removeAttribute("tplextension");
}
if (componentWidget.hasAttribute("template-source")){
componentBody.setAttribute("template-source",componentWidget.getAttribute("template-source"));
componentWidget.removeAttribute("template-source");
}
if (componentWidget.hasAttribute("data")){
componentBody.setAttribute("data",componentWidget.getAttribute("data"));
componentWidget.removeAttribute("data");
}
__enabled__atributes__.map (function (attributeName){
if (componentWidget.hasAttribute(attributeName)){
componentBody.setAttribute(attributeName,componentWidget.getAttribute(attributeName));
componentWidget.removeAttribute(attributeName);
}
});
var data_attributenames = componentWidget.getAttributeNames().filter(function(a) {
return a.startsWith("data-");
}).map(function(a) {
Expand Down

0 comments on commit f05fbe2

Please sign in to comment.