Commit 1f641dbf by NGUYEN HOANG SON

fix bug: load dashboard setting json failed

parent e6f25fa5
...@@ -653,6 +653,11 @@ CHK.loadDashboardSetting = function(callback) { ...@@ -653,6 +653,11 @@ CHK.loadDashboardSetting = function(callback) {
if (callback) { if (callback) {
callback(); callback();
} }
}, function(jqXHR, textStatus) {
//none dashboard setting json file, use default
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');
...@@ -776,8 +781,9 @@ CHK.updateReportJsonWeb = function(json, callback) { ...@@ -776,8 +781,9 @@ CHK.updateReportJsonWeb = function(json, callback) {
* *
* @param fileName JSONファイル名 * @param fileName JSONファイル名
* @param callback コールバック * @param callback コールバック
* @param fail
*/ */
CHK.loadJson = function(fileName, callback) { CHK.loadJson = function(fileName, callback, fail = null) {
if (CHK.isAndroid) { if (CHK.isAndroid) {
fileName = android.getCachePath() + "/" + fileName; fileName = android.getCachePath() + "/" + fileName;
} else if (CHK.isIOS) { } else if (CHK.isIOS) {
...@@ -812,6 +818,9 @@ CHK.loadJson = function(fileName, callback) { ...@@ -812,6 +818,9 @@ CHK.loadJson = function(fileName, callback) {
}).fail(function(jqXHR, textStatus, errorThrown) { }).fail(function(jqXHR, textStatus, errorThrown) {
console.log("エラー:" + textStatus); console.log("エラー:" + textStatus);
console.log("テキスト:" + jqXHR.responseText); console.log("テキスト:" + jqXHR.responseText);
if (fail) {
fail(jqXHR, textStatus);
}
}); });
} }
......
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