diff --git a/hyperglass/static/hyperglass.es6 b/hyperglass/static/hyperglass.es6
index d9fa110..d65489d 100644
--- a/hyperglass/static/hyperglass.es6
+++ b/hyperglass/static/hyperglass.es6
@@ -33,6 +33,8 @@ const footerTermsBtn = $('#hg-footer-terms-btn');
const footerCreditBtn = $('#hg-footer-credit-btn');
const footerPopoverTemplate = '
@@ -388,28 +383,41 @@ $(document).on('InvalidInputEvent', (e, domField) => {
$('#lgForm').on('submit', (e) => {
e.preventDefault();
submitIcon.empty().html('
').addClass('hg-loading');
- const queryType = $('#query_type').val();
- const queryLocation = $('#location').val();
- const queryTarget = $('#query_target').val();
- const queryVrf = $('#query_vrf').val() || null;
+ const queryType = $('#query_type').val() || '';
+ const queryLocation = $('#location').val() || '';
+ const queryTarget = $('#query_target').val() || '';
+ const queryVrf = $('#query_vrf').val() || [];
+
+ const queryTargetContainer = $('#query_target');
+ const queryTypeContainer = $('#query_type').next('.dropdown-toggle');
+ const queryLocationContainer = $('#location').next('.dropdown-toggle');
try {
// message, thing to circle in red, place to put error text
if (!queryTarget) {
- const queryTargetContainer = $('#query_target');
- throw new InputInvalid(inputMessages.no_input, queryTargetContainer, queryTargetContainer.parent());
+ throw new InputInvalid(
+ inputMessages.no_input,
+ queryTargetContainer,
+ queryTargetContainer.parent(),
+ );
}
if (!queryType) {
- const queryTypeContainer = $('#query_type').next('.dropdown-toggle');
- throw new InputInvalid(inputMessages.no_query_type, queryTypeContainer, queryTypeContainer.parent());
+ throw new InputInvalid(
+ inputMessages.no_query_type,
+ queryTypeContainer,
+ queryTypeContainer.parent(),
+ );
}
if (queryLocation === undefined || queryLocation.length === 0) {
- const queryLocationContainer = $('#location').next('.dropdown-toggle');
- throw new InputInvalid(inputMessages.no_location, queryLocationContainer, queryLocationContainer.parent());
+ throw new InputInvalid(
+ inputMessages.no_location,
+ queryLocationContainer,
+ queryLocationContainer.parent(),
+ );
}
} catch (err) {
err.field.addClass('is-invalid');
- err.container.append(`
${err.message}
`);
+ err.container.append(feedbackInvalid(err.message));
submitIcon.empty().removeClass('hg-loading').html('
');
$(document).trigger('InvalidInputEvent', err.field);
return false;
@@ -426,7 +434,12 @@ $('#lgForm').on('submit', (e) => {
$('#hg-back-btn').animsition('in');
});
-$('#hg-back-btn').click(() => {
+titleColumn.on('click', (e) => {
+ window.location = $(e.currentTarget).data('href');
+ return false;
+});
+
+backButton.click(() => {
resetResults();
});
@@ -457,12 +470,9 @@ $('#hg-accordion').on('mouseleave', '.hg-done', (e) => {
$('#hg-accordion').on('click', '.hg-done', (e) => {
const thisLocation = $(e.currentTarget).data('location');
- console.log(`Refreshing ${thisLocation}`);
const queryType = $('#query_type').val();
const queryTypeTitle = $(`#${queryType}`).data('display-name');
const queryTarget = $('#query_target').val();
-
-
queryApp(queryType, queryTypeTitle, [thisLocation], queryTarget);
});