optimize recorder

This commit is contained in:
OttoMao
2015-08-06 23:13:17 +08:00
parent edaf638f3c
commit 39ae0f4648
7 changed files with 101 additions and 43 deletions

View File

@@ -114,6 +114,15 @@ var recorder;
}
}
function initRecordSet(){
$.getJSON("/lastestLog",function(res){
if(typeof res == "object"){
recordSet = res;
eventCenter.dispatchEvent("recordSetUpdated");
}
});
}
eventCenter.addListener("wsGetUpdate",updateRecordSet);
eventCenter.addListener('recordSetUpdated',function(){
@@ -137,6 +146,8 @@ var recorder;
React.createElement(RecordPanel, {onSelect: showDetail}),
document.getElementById("J_content")
);
initRecordSet();
})();

View File

@@ -160,6 +160,15 @@
}
}
function initRecordSet(){
$.getJSON("/lastestLog",function(res){
if(typeof res == "object"){
recordSet = res;
eventCenter.dispatchEvent("recordSetUpdated");
}
});
}
eventCenter.addListener("wsGetUpdate",updateRecordSet);
eventCenter.addListener('recordSetUpdated',function(){
@@ -183,6 +192,8 @@
React.createElement(RecordPanel, {onSelect: showDetail}),
document.getElementById("J_content")
);
initRecordSet();
})();

View File

@@ -114,6 +114,15 @@ var recorder;
}
}
function initRecordSet(){
$.getJSON("/lastestLog",function(res){
if(typeof res == "object"){
recordSet = res;
eventCenter.dispatchEvent("recordSetUpdated");
}
});
}
eventCenter.addListener("wsGetUpdate",updateRecordSet);
eventCenter.addListener('recordSetUpdated',function(){
@@ -137,6 +146,8 @@ var recorder;
<RecordPanel onSelect={showDetail}/>,
document.getElementById("J_content")
);
initRecordSet();
})();