Commit abd71600 by NGUYEN HOANG SON

change call push message list init when ready

parent 3e8b4c1e
......@@ -24,12 +24,17 @@
<script src="../common/js/constant.js?__UPDATEID__"></script>
<script src="../common/js/common.js?__UPDATEID__"></script>
<script type="text/javascript" src="../js/template/template.js"></script>
<script type="text/javascript" src="../js/pushMessageList/push-message-list.js"></script>
<script type="text/javascript">
$(document).ready(function(){
PushMessageList.init();
});
</script>
</head>
<body onload="PushMessageList.init();">
<body>
<!-- header -->
<div id="includedHeader"></div>
......
......@@ -9,9 +9,7 @@ PushMessageList.baseApiUrl = CONSTANT.URL.CMS.BASE + ClientData.userInfo_account
* Init when html onload
*/
PushMessageList.init = function() {
$("#includedHeader").load("../common/header.html" , function() {
I18N.initi18n();
});
TEMPLATE.loadHearder("#includedHeader");
PushMessageList.getMessageList(function(messageList) {
PushMessageList.generateMessageListHtml(messageList.pushMessageList);
});
......@@ -26,15 +24,12 @@ PushMessageList.getMessageList = function (callback) {
sid: COMMON.getSid(),
};
const url = PushMessageList.baseApiUrl;
COMMON.cmsAjax(url, param, false, function (json) {
COMMON.cmsAjax(url, param, true, function (json) {
if (callback) {
callback(json);
}
}, function() {
console.log('PushMessageList.getMessageList error');
if (callback) {
callback(PushMessageList.dummyMessageListJson);
}
});
};
......
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