Commit 64558746 by NGUYEN HOANG SON

implement setting change callback

parent cd4748af
......@@ -115,7 +115,7 @@ DASHBOARD.init = function() {
/** load common data */
DASHBOARD.loadCommon = function() {
TEMPLATE.loadHearder("#includedHeader");
TEMPLATE.loadDashboardSetting("#includedDashboardSetting");
TEMPLATE.loadDashboardSetting("#includedDashboardSetting", DASHBOARD.changeSettingCallback);
TEMPLATE.loadConfirmModal("#includedConfirmModal");
}
......@@ -161,3 +161,10 @@ DASHBOARD.goMessageList = function() {
DASHBOARD.goSendMessage = function() {
COMMON.goUrlWithCurrentParams('send-message.html', {});
}
/**
* callback when setting changed
*/
DASHBOARD.changeSettingCallback = function() {
location.reload();
}
......@@ -11,10 +11,14 @@ TEMPLATE.loadHearder = function(elmentId) {
});
}
/** template load dashboard setting */
TEMPLATE.loadDashboardSetting = function(elmentId) {
/**
* template load dashboard setting
* @param {string} elmentId - element to load setting html
* @param {*} changeCallback - callback when setting changed
*/
TEMPLATE.loadDashboardSetting = function(elmentId, changeCallback) {
$(elmentId).load("dashboard-setting.html", function() {
DashboardSetting.init();
DashboardSetting.init(changeCallback);
I18N.initi18n();
});
}
......
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