#114 first pass at choosing quality profile when approving + focus search input by default and when switching tabs

This commit is contained in:
Drewster727 2016-04-03 17:30:12 -05:00
commit 9ac949a67c
16 changed files with 325 additions and 77 deletions

View file

@ -20,6 +20,10 @@ $(function () {
$tabs.first().children('a:first-child').tab('show');
}
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
focusSearch($($(e.target).attr('href')))
});
focusSearch($('li.active a', '#nav-tabs').first().attr('href'));
// Type in movie search
$("#movieSearchContent").on("input", function () {
@ -132,9 +136,14 @@ $(function () {
var data = $form.serialize();
sendRequestAjax(data, type, url, buttonId);
});
function focusSearch($content) {
if ($content.length > 0) {
$('input[type=text].form-control', $content).first().focus();
}
}
function sendRequestAjax(data, type, url, buttonId) {
$.ajax({
type: type,