mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-22 10:46:06 +02:00
Move back helpers into the watched folders
This commit is contained in:
parent
58db81c41d
commit
71e6e9240e
13 changed files with 45 additions and 38 deletions
|
@ -1,4 +1,4 @@
|
|||
import { hideElement, showElement, addOrRemoveSessionBoolean } from '../modules-common/helpers.js';
|
||||
import { hideElement, showElement, addOrRemoveSessionBoolean } from './helpers-admin.js';
|
||||
import { handlePortfolioSelection } from './helpers-portfolio-dynamic-fields.js';
|
||||
|
||||
function displayModalOnDropdownClick(linkClickedDisplaysModal, statusDropdown, actionButton, valueToCheck){
|
||||
|
@ -113,7 +113,7 @@ export function initApprovedDomain() {
|
|||
function updateFormGroupVisibility(showFormGroups) {
|
||||
if (showFormGroups) {
|
||||
showElement(approvedDomainFormGroup);
|
||||
}else {
|
||||
} else {
|
||||
hideElement(approvedDomainFormGroup);
|
||||
}
|
||||
}
|
||||
|
|
17
src/registrar/assets/modules-admin/helpers-admin.js
Normal file
17
src/registrar/assets/modules-admin/helpers-admin.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
export function hideElement(element) {
|
||||
console.log(element)
|
||||
element.classList.add('display-none');
|
||||
};
|
||||
|
||||
export function showElement(element) {
|
||||
element.classList.remove('display-none');
|
||||
};
|
||||
|
||||
// Adds or removes a boolean from our session
|
||||
export function addOrRemoveSessionBoolean(name, add){
|
||||
if (add) {
|
||||
sessionStorage.setItem(name, "true");
|
||||
}else {
|
||||
sessionStorage.removeItem(name);
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
import { hideElement, showElement } from '../modules-common/helpers.js';
|
||||
import { hideElement, showElement } from './helpers-admin.js';
|
||||
|
||||
/**
|
||||
* Helper function that handles business logic for the suborganization field.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { hideElement, showElement } from '../modules-common/helpers.js';
|
||||
import { hideElement, showElement } from './helpers-admin.js';
|
||||
|
||||
/**
|
||||
* A function for dynamically changing some fields on the portfolio admin model
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { hideElement } from '../modules-common/helpers.js';
|
||||
import { hideElement } from './helpers-admin.js';
|
||||
|
||||
/** An IIFE for toggling the overflow styles on django-admin__model-description (the show more / show less button) */
|
||||
export function initDescriptions() {
|
||||
|
@ -8,6 +8,7 @@ export function initDescriptions() {
|
|||
// Hide the toggle button if text content is less than 200 characters
|
||||
// This is a little over 160 characters to give us some wiggle room if we
|
||||
// change the font size marginally.
|
||||
if (toggleButton)
|
||||
hideElement(toggleButton);
|
||||
} else {
|
||||
toggleButton.addEventListener('click', function() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { hideElement, showElement } from '../modules-common/helpers.js';
|
||||
import { hideElement, showElement } from './helpers.js';
|
||||
|
||||
export function loadInitialValuesForComboBoxes() {
|
||||
var overrideDefaultClearButton = true;
|
||||
|
|
|
@ -67,12 +67,3 @@ export function debounce(handler, cooldown=600) {
|
|||
timeout = setTimeout(() => handler.apply(context, args), cooldown);
|
||||
}
|
||||
}
|
||||
|
||||
// Adds or removes a boolean from our session
|
||||
export function addOrRemoveSessionBoolean(name, add){
|
||||
if (add) {
|
||||
sessionStorage.setItem(name, "true");
|
||||
}else {
|
||||
sessionStorage.removeItem(name);
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
import { hideElement, showElement } from '../modules-common/helpers.js';
|
||||
import { hideElement, showElement } from './helpers.js';
|
||||
|
||||
/** A function that intializes the requesting entity page.
|
||||
* This page has a radio button that dynamically toggles some fields
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { hideElement, showElement, toggleCaret } from '../modules-common/helpers.js';
|
||||
import { hideElement, showElement, toggleCaret } from './helpers.js';
|
||||
|
||||
export class LoadTableBase {
|
||||
constructor(sectionSelector) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { hideElement, showElement, scrollToElement } from '../modules-common/helpers.js';
|
||||
import { hideElement, showElement, scrollToElement } from './helpers.js';
|
||||
import { initializeModals, unloadModals } from './helpers-uswds.js';
|
||||
import { getCsrfToken } from './helpers-csrf-token.js';
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { scrollToElement } from '../modules-common/helpers.js';
|
||||
import { scrollToElement } from './helpers.js';
|
||||
import { initializeTooltips } from './helpers-uswds.js';
|
||||
|
||||
import { LoadTableBase } from './table-base.js';
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
import { hideElement, showElement, scrollToElement, toggleCaret } from '../modules-common/helpers.js';
|
||||
import { initializeTooltips, initializeModals, unloadModals } from './helpers-uswds.js';
|
||||
import { getCsrfToken } from './helpers-csrf-token.js';
|
||||
import { scrollToElement } from './helpers.js';
|
||||
|
||||
import { LoadTableBase } from './table-base.js';
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { hideElement, showElement, scrollToElement } from '../modules-common/helpers.js';
|
||||
import { hideElement, showElement, scrollToElement } from './helpers.js';
|
||||
|
||||
import { LoadTableBase } from './table-base.js';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue