mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-08-04 21:39:04 +00:00
add a filter on web ui
This commit is contained in:
@@ -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);
|
||||
});
|
||||
})();
|
||||
Reference in New Issue
Block a user