From 237f4cbc6c4e9a32e6d48d02c1d4cdfc07651e7e Mon Sep 17 00:00:00 2001 From: megala21 Date: Thu, 14 Sep 2017 14:38:01 +0530 Subject: [PATCH] Refactoring --- .../src/main/resources/publisher/src/theme.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/theme.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/theme.js index 492a623be25..02b3f199646 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/theme.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/theme.js @@ -38,6 +38,10 @@ class Theme { this.loadThemeFiles.bind(this); } + /** + * To load the theme files from the configuration file. + * @returns the http response. + */ loadThemeProperties () { let httpClient = axios.create({ baseURL: this.baseURL + "/" + this.appContext + "/config.json", @@ -47,14 +51,11 @@ class Theme { return httpClient.get(); } - loadTheme () { - let httpClient = axios.create({ - baseURL: this.baseURL + "/" + this.appContext + "/themes/custom-theme/theme.js", - timeout: 2000 - }); - return httpClient.get(); - } - + /** + * To load the particular theme file from the path. + * @param path Path to load the theme files + * @returns Http response from the particular file. + */ loadThemeFiles (path) { let httpClient = axios.create({ baseURL: this.baseURL + "/" + this.appContext + path,