Commit 71980da6 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Add simple search box to the top of the profile picker.

parent c3fb6df3
......@@ -54,6 +54,32 @@ function (_, sup, aboutaptString, aboutcloudString)
$("#waitwait").modal('show');
return true;
});
// Profile picker search box.
var profile_picker_timeout = null;
$("#profile_picker_search").on("keyup", function () {
var options = $('#profile_name');
var userInput = $("#profile_picker_search").val();
userInput = userInput.toLowerCase();
window.clearTimeout(profile_picker_timeout);
profile_picker_timeout =
window.setTimeout(function() {
var matches =
options.children("li").filter(function() {
var text = $(this).text();
text = text.toLowerCase();
if (text.indexOf(userInput) > -1)
return true;
return false;
});
options.children("li").hide();
matches.show();
}, 500);
});
var startProfile = $('#profile_name li[value = ' + window.PROFILE + ']')
ChangeProfileSelection(startProfile);
_.delay(function () {$('.dropdown-toggle').dropdown();}, 500);
......
......@@ -515,6 +515,9 @@ function SpitTopologyViewModal($modal_name, $profile_array)
<div class='panel panel-default'
id='showtopo_container'>
<div class='form-group pull-left'>
<input type='text' class='form-control'
placeholder='Search'
id='profile_picker_search'>
<ul class='list-group' id='profile_name'
name='profile'
>\n";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment