Skip to content

Commit

Permalink
improve ComponentURI
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanmachuca committed May 10, 2023
1 parent de0880d commit 83a3cf7
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/QCObjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -2550,7 +2550,9 @@
_component_.subcomponents = _component_.__buildSubComponents__();

_component_._bindroute_();
_component_.body.setAttribute("loaded", true);
if (isBrowser){
_component_.body.setAttribute("loaded", true);
}
};

return new Promise (function (resolve, reject){
Expand All @@ -2565,11 +2567,15 @@

hostElements(tagFilter){
var _component_ = this;
var elementList = (_component_.shadowed && (typeof _component_.shadowRoot !== "undefined"))?(
_component_.shadowRoot.subelements(tagFilter)
):(
_component_.body.subelements(tagFilter)
);
var elementList = [];
if (isBrowser){
elementList = (_component_.shadowed && (typeof _component_.shadowRoot !== "undefined"))?(
_component_.shadowRoot.subelements(tagFilter)
):(
_component_.body.subelements(tagFilter)
);

}
return elementList;
}

Expand Down Expand Up @@ -3374,15 +3380,9 @@
* @author: Jean Machuca <[email protected]>
* @param params an object with the params to build the uri path
*/
var ComponentURI = function (params) {
var templateURI = "";
if (params["TPL_SOURCE"] === "default") {
templateURI = "{{COMPONENTS_BASE_PATH}}{{COMPONENT_NAME}}.{{TPLEXTENSION}}";
for (var k in params) {
var param = params[k];
templateURI = templateURI.replace("{{" + k + "}}", params[k]);
}
}
var ComponentURI = ({TPL_SOURCE ,COMPONENTS_BASE_PATH, COMPONENT_NAME, TPLEXTENSION}) => {
const templateURI = (TPL_SOURCE === "default")?(`${COMPONENTS_BASE_PATH}${COMPONENT_NAME}${TPLEXTENSION}`):("");
logger.debug(`templateURI: ${templateURI}`);
return templateURI;
};

Expand Down Expand Up @@ -3607,7 +3607,7 @@
}
return Promise.reject(_ret_);
}).catch(function (e) {
logger.debug("Something wrong loading the component");
logger.debug(`Something wrong loading the component: ${e}`);
});
return __promise__;
};
Expand Down

0 comments on commit 83a3cf7

Please sign in to comment.