Commit 42cdd05c by NGUYEN HOANG SON

#49153 implement save, load dashboard setting json

parent 67bd1acb
...@@ -60,13 +60,15 @@ CHK_DashboardSetting.bindToggleClick = function() { ...@@ -60,13 +60,15 @@ CHK_DashboardSetting.bindToggleClick = function() {
CHK_DashboardSetting.init = function() { CHK_DashboardSetting.init = function() {
CHK.initCommon(); CHK.initCommon();
CHK.loadDashboardSetting(); CHK.loadDashboardSetting(function() {
CHK_DashboardSetting.loadSettings(); CHK_DashboardSetting.loadSettings();
CHK_DashboardSetting.initDisplays(); CHK_DashboardSetting.initDisplays();
CHK_DashboardSetting.bindToggleClick();
});
$("#footer").load("main-footer.html", function() { $("#footer").load("main-footer.html", function() {
CHK_Footer.activeDashboardBottomNav(); CHK_Footer.activeDashboardBottomNav();
}); });
CHK_DashboardSetting.bindToggleClick();
} }
CHK_DashboardSetting.goBack = function() { CHK_DashboardSetting.goBack = function() {
......
...@@ -560,11 +560,14 @@ CHK.initPushMessageList = function() { ...@@ -560,11 +560,14 @@ CHK.initPushMessageList = function() {
}); });
} }
CHK.loadDashboardSetting = function() { CHK.loadDashboardSetting = function(callback) {
CHK.loadJson(CHK.jsonPath.dashboardSetting, function(json) { CHK.loadJson(CHK.jsonPath.dashboardSetting, function(json) {
if (json) { if (json) {
CHK.dashboardSetting = json; CHK.dashboardSetting = json;
} }
if (callback) {
callback();
}
}); });
// ios clear localStorage when reopen index page // ios clear localStorage when reopen index page
// var setting = localStorage.getItem('dashboardSetting'); // var setting = localStorage.getItem('dashboardSetting');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment