Commit 23123d6f by NGUYEN HOANG SON

#49153 improve save, load dashboard setting

parent 42cdd05c
...@@ -11,6 +11,12 @@ CHK_DashboardSetting.loadSettings = function() { ...@@ -11,6 +11,12 @@ CHK_DashboardSetting.loadSettings = function() {
let enabled = CHK.dashboardSetting[item.id]; let enabled = CHK.dashboardSetting[item.id];
if (typeof enabled !== 'undefined') { if (typeof enabled !== 'undefined') {
item.enabled = enabled; item.enabled = enabled;
let itemElement = $('#' + item.id);
if (item.enabled) {
itemElement.addClass('checked');
} else {
itemElement.removeClass('checked');
}
} }
}); });
} }
...@@ -60,15 +66,14 @@ CHK_DashboardSetting.bindToggleClick = function() { ...@@ -60,15 +66,14 @@ CHK_DashboardSetting.bindToggleClick = function() {
CHK_DashboardSetting.init = function() { CHK_DashboardSetting.init = function() {
CHK.initCommon(); CHK.initCommon();
CHK.loadDashboardSetting(function() { CHK_DashboardSetting.initDisplays();
CHK_DashboardSetting.loadSettings(); CHK_DashboardSetting.bindToggleClick();
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.loadDashboardSetting(function() {
CHK_DashboardSetting.loadSettings();
});
} }
CHK_DashboardSetting.goBack = function() { CHK_DashboardSetting.goBack = function() {
......
...@@ -400,6 +400,7 @@ CHK.initCommon = function() { ...@@ -400,6 +400,7 @@ CHK.initCommon = function() {
//save url parameter of top page //save url parameter of top page
CHK.saveInitSession(); CHK.saveInitSession();
} }
CHK.loadDashboardSetting();
// ウェブの場合、作業一覧の表示広さを変更 // ウェブの場合、作業一覧の表示広さを変更
if (CHK.isWeb) { if (CHK.isWeb) {
...@@ -443,7 +444,6 @@ CHK.initCommon = function() { ...@@ -443,7 +444,6 @@ CHK.initCommon = function() {
CHK.init = function() { CHK.init = function() {
//共通処理 //共通処理
CHK.initCommon(); CHK.initCommon();
CHK.loadDashboardSetting();
//VR設定 //VR設定
krpano.call("set(content[def].useVr, false);"); krpano.call("set(content[def].useVr, false);");
......
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