issue中我的issue,指派给我的issue和全部issue js实现

This commit is contained in:
huang 2016-09-22 13:41:46 +08:00
parent 2ae7dd0087
commit 80105181ce
1 changed files with 30 additions and 0 deletions

View File

@ -43,6 +43,30 @@
}
}
// 点击的时候让过滤条件选中assign_to
function switch_assign_to(assign) {
var assign = "option[value =" + assign + "]"
$("#assignToMe").click(function(){
});
$("select[id='assigned_to_id']").find(assign).attr("selected", "selected");
remote_function();
}
// 点击的时候让过滤条件选中user_id
function createByMe(user_id) {
var user = "option[value =" + user_id + "]"
$("#createByMe").click(function(){
});
$("select[id='author_id']").find(user).attr("selected", "selected");
remote_function();
}
function all_reset_form() {
$("#issue_query_form")[0].reset();
remote_function();
}
</script>
@ -92,6 +116,11 @@
)
%>
</div><!--filter_form end-->
<a href="javascript:void(0);" onclick="switch_assign_to(<%= User.current.id %>)" id="assignToMe">指派我的</a>
<a href="javascript:void(0);" onclick="all_reset_form();">所有的</a>
<a href="javascript:void(0);" onclick="createByMe(<%= User.current.id %>)" id="createByMe">我发布的</a>
<div>
<div class="fl">&nbsp;</div>
<div>
@ -113,6 +142,7 @@
<% end %>
</div>
<div class="contextual">
<% if !@query.new_record? && @query.editable_by?(User.current) %>
<%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %>