mirror of
				https://github.com/checktheroads/hyperglass
				synced 2024-05-11 05:55:08 +00:00 
			
		
		
		
	fix responsive styling
This commit is contained in:
		@@ -9,14 +9,16 @@ const ClipboardJS = require('clipboard');
 | 
			
		||||
const frontEndConfig = require('./frontend.json');
 | 
			
		||||
 | 
			
		||||
const inputMessages = frontEndConfig.messages;
 | 
			
		||||
const pageContainer = $('#hg-page-container');
 | 
			
		||||
const formContainer = $('#hg-form');
 | 
			
		||||
const queryLocation = $('#location');
 | 
			
		||||
const queryType = $('#query_type');
 | 
			
		||||
const queryTarget = $('#query_target');
 | 
			
		||||
const queryTargetAppend = $('#hg-target-append');
 | 
			
		||||
const submitIcon = $('#hg-submit-icon');
 | 
			
		||||
const resultsContainer = $('#hg-results');
 | 
			
		||||
const formContainer = $('#hg-form');
 | 
			
		||||
const resultsAccordion = $('#hg-accordion');
 | 
			
		||||
const resultsColumn = resultsAccordion.parent();
 | 
			
		||||
const backButton = $('#hg-back-btn');
 | 
			
		||||
const footerHelpBtn = $('#hg-footer-help-btn');
 | 
			
		||||
const footerTermsBtn = $('#hg-footer-terms-btn');
 | 
			
		||||
@@ -33,6 +35,16 @@ class InputInvalid extends Error {
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const swapSpacing = (goTo) => {
 | 
			
		||||
  if (goTo === 'form') {
 | 
			
		||||
    pageContainer.removeClass('px-0 px-md-3');
 | 
			
		||||
    resultsColumn.removeClass('px-0');
 | 
			
		||||
  } else if (goTo === 'results') {
 | 
			
		||||
    pageContainer.addClass('px-0 px-md-3');
 | 
			
		||||
    resultsColumn.addClass('px-0');
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const resetResults = () => {
 | 
			
		||||
  queryLocation.selectpicker('deselectAll');
 | 
			
		||||
  queryLocation.selectpicker('val', '');
 | 
			
		||||
@@ -41,6 +53,7 @@ const resetResults = () => {
 | 
			
		||||
  resultsContainer.animsition('out', formContainer, '#');
 | 
			
		||||
  resultsContainer.hide();
 | 
			
		||||
  $('.hg-info-btn').remove();
 | 
			
		||||
  swapSpacing('form');
 | 
			
		||||
  formContainer.show();
 | 
			
		||||
  formContainer.animsition('in');
 | 
			
		||||
  backButton.addClass('d-none');
 | 
			
		||||
@@ -114,9 +127,12 @@ const supportedBtn = qt => `<button class="btn btn-dark hg-info-btn" id="hg-info
 | 
			
		||||
 | 
			
		||||
queryType.on('changed.bs.select', () => {
 | 
			
		||||
  const queryTypeId = queryType.val();
 | 
			
		||||
  const queryTypeBtn = $('.hg-info-btn');
 | 
			
		||||
  if ((queryTypeId === 'bgp_community') || (queryTypeId === 'bgp_aspath')) {
 | 
			
		||||
    $('.hg-info-btn').remove();
 | 
			
		||||
    queryTypeBtn.remove();
 | 
			
		||||
    queryTargetAppend.prepend(supportedBtn(queryTypeId));
 | 
			
		||||
  } else {
 | 
			
		||||
    queryTypeBtn.remove();
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
@@ -288,6 +304,7 @@ $('#lgForm').submit((event) => {
 | 
			
		||||
  queryApp(queryType, queryTypeTitle, queryLocation, queryTarget);
 | 
			
		||||
  $('#hg-form').animsition('out', $('#hg-results'), '#');
 | 
			
		||||
  $('#hg-form').hide();
 | 
			
		||||
  swapSpacing('results');
 | 
			
		||||
  $('#hg-results').show();
 | 
			
		||||
  $('#hg-results').animsition('in');
 | 
			
		||||
  $('#hg-submit-spinner').remove();
 | 
			
		||||
@@ -301,10 +318,11 @@ $('#hg-back-btn').click(() => {
 | 
			
		||||
 | 
			
		||||
const clipboard = new ClipboardJS('.hg-copy-btn');
 | 
			
		||||
clipboard.on('success', (e) => {
 | 
			
		||||
  $(e.trigger).find('.hg-copy-icon').removeClass('remixicon-checkbox-multiple-blank-line').addClass('remixicon-checkbox-multiple-line');
 | 
			
		||||
  const copyIcon = $(e.trigger).find('.hg-copy-icon');
 | 
			
		||||
  copyIcon.removeClass('remixicon-checkbox-multiple-blank-line').addClass('remixicon-checkbox-multiple-line');
 | 
			
		||||
  e.clearSelection();
 | 
			
		||||
  setTimeout(() => {
 | 
			
		||||
    $(e.trigger).find('.hg-copy-icon').removeClass('remixicon-checkbox-multiple-line').addClass('remixicon-checkbox-multiple-blank-line');
 | 
			
		||||
    copyIcon.removeClass('remixicon-checkbox-multiple-line').addClass('remixicon-checkbox-multiple-blank-line');
 | 
			
		||||
  }, 800);
 | 
			
		||||
});
 | 
			
		||||
clipboard.on('error', (e) => {
 | 
			
		||||
 
 | 
			
		||||
@@ -13,8 +13,8 @@
 | 
			
		||||
    .mw-sm-100
 | 
			
		||||
        max-width: 100% !important
 | 
			
		||||
 | 
			
		||||
    .mw-sm-auto
 | 
			
		||||
        max-width: auto !important
 | 
			
		||||
    .mw-sm-none
 | 
			
		||||
        max-width: none !important
 | 
			
		||||
 | 
			
		||||
    .mh-sm-25
 | 
			
		||||
        max-height: 25% !important
 | 
			
		||||
@@ -28,8 +28,8 @@
 | 
			
		||||
    .mh-sm-100
 | 
			
		||||
        max-height: 100% !important
 | 
			
		||||
 | 
			
		||||
    .mh-sm-auto
 | 
			
		||||
        max-height: auto !important
 | 
			
		||||
    .mh-sm-none
 | 
			
		||||
        max-height: none !important
 | 
			
		||||
 | 
			
		||||
@media (min-width: 768px)
 | 
			
		||||
    .mw-md-25
 | 
			
		||||
@@ -44,8 +44,8 @@
 | 
			
		||||
    .mw-md-100
 | 
			
		||||
        max-width: 100% !important
 | 
			
		||||
 | 
			
		||||
    .mw-md-auto
 | 
			
		||||
        max-width: auto !important
 | 
			
		||||
    .mw-md-none
 | 
			
		||||
        max-width: none !important
 | 
			
		||||
 | 
			
		||||
    .mh-md-25
 | 
			
		||||
        max-height: 25% !important
 | 
			
		||||
@@ -59,8 +59,8 @@
 | 
			
		||||
    .mh-md-100
 | 
			
		||||
        max-height: 100% !important
 | 
			
		||||
 | 
			
		||||
    .mh-md-auto
 | 
			
		||||
        max-height: auto !important
 | 
			
		||||
    .mh-md-none
 | 
			
		||||
        max-height: none !important
 | 
			
		||||
 | 
			
		||||
@media (min-width: 992px)
 | 
			
		||||
    .mw-lg-25
 | 
			
		||||
@@ -75,8 +75,8 @@
 | 
			
		||||
    .mw-lg-100
 | 
			
		||||
        max-width: 100% !important
 | 
			
		||||
 | 
			
		||||
    .mw-lg-auto
 | 
			
		||||
        max-width: auto !important
 | 
			
		||||
    .mw-lg-none
 | 
			
		||||
        max-width: none !important
 | 
			
		||||
 | 
			
		||||
    .mh-lg-25
 | 
			
		||||
        max-height: 25% !important
 | 
			
		||||
@@ -90,8 +90,8 @@
 | 
			
		||||
    .mh-lg-100
 | 
			
		||||
        max-height: 100% !important
 | 
			
		||||
 | 
			
		||||
    .mh-lg-auto
 | 
			
		||||
        max-height: auto !important
 | 
			
		||||
    .mh-lg-none
 | 
			
		||||
        max-height: none !important
 | 
			
		||||
 | 
			
		||||
@media (min-width: 1200px)
 | 
			
		||||
    .mw-xl-25
 | 
			
		||||
@@ -106,8 +106,8 @@
 | 
			
		||||
    .mw-xl-100
 | 
			
		||||
        max-width: 100% !important
 | 
			
		||||
 | 
			
		||||
    .mw-xl-auto
 | 
			
		||||
        max-width: auto !important
 | 
			
		||||
    .mw-xl-none
 | 
			
		||||
        max-width: none !important
 | 
			
		||||
 | 
			
		||||
    .mh-xl-25
 | 
			
		||||
        max-height: 25% !important
 | 
			
		||||
@@ -121,8 +121,8 @@
 | 
			
		||||
    .mh-xl-100
 | 
			
		||||
        max-height: 100% !important
 | 
			
		||||
 | 
			
		||||
    .mh-xl-auto
 | 
			
		||||
        max-height: auto !important
 | 
			
		||||
    .mh-xl-none
 | 
			
		||||
        max-height: none !important
 | 
			
		||||
@media (min-width: 576px)
 | 
			
		||||
    .mw-sm-25
 | 
			
		||||
        max-width: 25% !important
 | 
			
		||||
@@ -136,8 +136,8 @@
 | 
			
		||||
    .mw-sm-100
 | 
			
		||||
        max-width: 100% !important
 | 
			
		||||
 | 
			
		||||
    .mw-sm-auto
 | 
			
		||||
        max-width: auto !important
 | 
			
		||||
    .mw-sm-none
 | 
			
		||||
        max-width: none !important
 | 
			
		||||
 | 
			
		||||
    .mh-sm-25
 | 
			
		||||
        max-height: 25% !important
 | 
			
		||||
@@ -151,8 +151,8 @@
 | 
			
		||||
    .mh-sm-100
 | 
			
		||||
        max-height: 100% !important
 | 
			
		||||
 | 
			
		||||
    .mh-sm-auto
 | 
			
		||||
        max-height: auto !important
 | 
			
		||||
    .mh-sm-none
 | 
			
		||||
        max-height: none !important
 | 
			
		||||
 | 
			
		||||
@media (min-width: 768px)
 | 
			
		||||
    .mw-md-25
 | 
			
		||||
@@ -167,8 +167,8 @@
 | 
			
		||||
    .mw-md-100
 | 
			
		||||
        max-width: 100% !important
 | 
			
		||||
 | 
			
		||||
    .mw-md-auto
 | 
			
		||||
        max-width: auto !important
 | 
			
		||||
    .mw-md-none
 | 
			
		||||
        max-width: none !important
 | 
			
		||||
 | 
			
		||||
    .mh-md-25
 | 
			
		||||
        max-height: 25% !important
 | 
			
		||||
@@ -182,8 +182,8 @@
 | 
			
		||||
    .mh-md-100
 | 
			
		||||
        max-height: 100% !important
 | 
			
		||||
 | 
			
		||||
    .mh-md-auto
 | 
			
		||||
        max-height: auto !important
 | 
			
		||||
    .mh-md-none
 | 
			
		||||
        max-height: none !important
 | 
			
		||||
 | 
			
		||||
@media (min-width: 992px)
 | 
			
		||||
    .mw-lg-25
 | 
			
		||||
@@ -198,8 +198,8 @@
 | 
			
		||||
    .mw-lg-100
 | 
			
		||||
        max-width: 100% !important
 | 
			
		||||
 | 
			
		||||
    .mw-lg-auto
 | 
			
		||||
        max-width: auto !important
 | 
			
		||||
    .mw-lg-none
 | 
			
		||||
        max-width: none !important
 | 
			
		||||
 | 
			
		||||
    .mh-lg-25
 | 
			
		||||
        max-height: 25% !important
 | 
			
		||||
@@ -213,8 +213,8 @@
 | 
			
		||||
    .mh-lg-100
 | 
			
		||||
        max-height: 100% !important
 | 
			
		||||
 | 
			
		||||
    .mh-lg-auto
 | 
			
		||||
        max-height: auto !important
 | 
			
		||||
    .mh-lg-none
 | 
			
		||||
        max-height: none !important
 | 
			
		||||
 | 
			
		||||
@media (min-width: 1200px)
 | 
			
		||||
    .mw-xl-25
 | 
			
		||||
@@ -229,8 +229,8 @@
 | 
			
		||||
    .mw-xl-100
 | 
			
		||||
        max-width: 100% !important
 | 
			
		||||
 | 
			
		||||
    .mw-xl-auto
 | 
			
		||||
        max-width: auto !important
 | 
			
		||||
    .mw-xl-none
 | 
			
		||||
        max-width: none !important
 | 
			
		||||
 | 
			
		||||
    .mh-xl-25
 | 
			
		||||
        max-height: 25% !important
 | 
			
		||||
@@ -244,8 +244,8 @@
 | 
			
		||||
    .mh-xl-100
 | 
			
		||||
        max-height: 100% !important
 | 
			
		||||
 | 
			
		||||
    .mh-xl-auto
 | 
			
		||||
        max-height: auto !important
 | 
			
		||||
    .mh-xl-none
 | 
			
		||||
        max-height: none !important
 | 
			
		||||
 | 
			
		||||
// hyperglass overrides
 | 
			
		||||
#hg-form
 | 
			
		||||
@@ -269,8 +269,8 @@
 | 
			
		||||
// Fixes input group issue where button is 1px taller than the input element (default is 2px)
 | 
			
		||||
 | 
			
		||||
#hg-submit-button
 | 
			
		||||
    border-top-right-radius: .3rem
 | 
			
		||||
    border-bottom-right-radius: .3rem
 | 
			
		||||
    border-top-right-radius: $border-radius-lg
 | 
			
		||||
    border-bottom-right-radius: $border-radius-lg
 | 
			
		||||
 | 
			
		||||
.input-group-lg > .form-control:not(textarea),
 | 
			
		||||
.input-group-lg > .custom-select,
 | 
			
		||||
@@ -292,6 +292,7 @@
 | 
			
		||||
    bottom: 5rem !important
 | 
			
		||||
    border-radius: 50rem !important
 | 
			
		||||
    border: 1px solid $card-border-color !important
 | 
			
		||||
    background-color: $hg-loading
 | 
			
		||||
    transition: all .3s !important
 | 
			
		||||
    font-weight: 200 !important
 | 
			
		||||
    font-size: 1.4rem !important
 | 
			
		||||
@@ -303,6 +304,10 @@
 | 
			
		||||
        font-weight: 200
 | 
			
		||||
        font-size: 1.4rem
 | 
			
		||||
 | 
			
		||||
#hg-accordion
 | 
			
		||||
    .card-body
 | 
			
		||||
        word-wrap: normal !important
 | 
			
		||||
 | 
			
		||||
.hg-menu-btn
 | 
			
		||||
    -webkit-transition: none
 | 
			
		||||
    -moz-transition: none
 | 
			
		||||
@@ -338,11 +343,12 @@
 | 
			
		||||
.hg-loading
 | 
			
		||||
    animation: spinner-border .75s linear infinite
 | 
			
		||||
 | 
			
		||||
.accordion
 | 
			
		||||
    div
 | 
			
		||||
        &.card
 | 
			
		||||
            &:only-child
 | 
			
		||||
                border-bottom: $card-border-width solid $card-border-color
 | 
			
		||||
.accordion > .card:only-of-type
 | 
			
		||||
    border-bottom: $card-border-width solid $card-border-color
 | 
			
		||||
    border-top-left-radius: $border-radius !important
 | 
			
		||||
    border-top-right-radius: $border-radius !important
 | 
			
		||||
    border-bottom-left-radius: $border-radius !important
 | 
			
		||||
    border-bottom-right-radius: $border-radius !important
 | 
			
		||||
 | 
			
		||||
.btn:focus,.btn:active
 | 
			
		||||
    outline: none !important
 | 
			
		||||
@@ -434,7 +440,4 @@
 | 
			
		||||
    padding-left: 0.3rem !important
 | 
			
		||||
 | 
			
		||||
.modal-title
 | 
			
		||||
    padding-bottom: 1rem !important
 | 
			
		||||
 | 
			
		||||
.form-control.is-invalid, .form-control.is-valid
 | 
			
		||||
    background-image: unset !important
 | 
			
		||||
    padding-bottom: 1rem !important
 | 
			
		||||
		Reference in New Issue
	
	Block a user