converts users/admin_merge js_block into js_bundle
test plan: * regression test users admin merge Change-Id: I781115b754b5f13bbab440673b5eab2f62928465 Reviewed-on: https://gerrit.instructure.com/29098 Tested-by: Jenkins <jenkins@instructure.com> Reviewed-by: Jon Jensen <jon@instructure.com> QA-Review: August Thornton <august@instructure.com> Product-Review: Landon Wilkins <lwilkins@instructure.com>
This commit is contained in:
parent
b2b9431901
commit
0c7e0c2b85
|
@ -0,0 +1,19 @@
|
|||
jQuery ->
|
||||
$select_name = $("#select_name")
|
||||
$selected_name = $("#selected_name")
|
||||
$("#account_select").change(->
|
||||
$(".account_search").hide()
|
||||
$("#account_search_" + $(this).val()).show()
|
||||
).change()
|
||||
$(".account_search .user_name").each ->
|
||||
$input = $(this)
|
||||
$input.autocomplete
|
||||
minLength: 4
|
||||
source: $input.data("autocompleteSource")
|
||||
|
||||
$input.bind "autocompleteselect autocompletechange", (event, ui) ->
|
||||
if ui.item
|
||||
$selected_name.text ui.item.label
|
||||
$select_name.show().attr "href", $.replaceTags($("#select_name").attr("rel"), "id", ui.item.id)
|
||||
else
|
||||
$select_name.hide()
|
|
@ -103,33 +103,7 @@
|
|||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<% js_block do %>
|
||||
<script type="text/javascript">
|
||||
jQuery(function(){
|
||||
var $select_name = $("#select_name"),
|
||||
$selected_name = $("#selected_name");
|
||||
$("#account_select").change(function() {
|
||||
$(".account_search").hide();
|
||||
$("#account_search_" + $(this).val()).show();
|
||||
}).change();
|
||||
$(".account_search .user_name").each(function() {
|
||||
var $input = $(this);
|
||||
$input.autocomplete({
|
||||
minLength: 4,
|
||||
source: $input.data('autocompleteSource')
|
||||
});
|
||||
$input.bind('autocompleteselect autocompletechange', function(event, ui){
|
||||
if (ui.item) {
|
||||
$selected_name.text(ui.item.label);
|
||||
$select_name.show().attr('href', $.replaceTags($("#select_name").attr('rel'), 'id', ui.item.id));
|
||||
} else {
|
||||
$select_name.hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<% end %>
|
||||
<% js_bundle 'legacy/users_admin_merge' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue