add a filter on web ui

This commit is contained in:
OttoMao
2015-07-01 23:18:35 +08:00
parent ab5bd5d6e6
commit b595e3aa9c
9 changed files with 207 additions and 15 deletions

View File

@@ -101,6 +101,12 @@ var eventCenter = new EventManager();
list : recordSet
});
});
eventCenter.addListener("filterUpdated",function(newKeyword){
Panel.setState({
filter: newKeyword
});
});
})();
@@ -138,4 +144,27 @@ var eventCenter = new EventManager();
ifPause = false;
}
});
function switchFilterWidget(ifToShow){
if(ifToShow){
$(".J_filterSection").show();
$("#J_filterKeyword").focus();
}else{
$(".J_filterSection").hide();
$("#J_filterKeyword").val("");
}
}
$(".J_toggleFilterBtn").on("click",function(){
switchFilterWidget( $(".J_filterSection").css("display") == "none" );
});
$(".J_filterCloseBtn").on("click",function(){
switchFilterWidget(false);
});
$("#J_filterKeyword").on("change keyup",function(){
eventCenter.dispatchEvent("filterUpdated",this.value);
});
})();