Browse Source
* Add standard task for linting JavaScript * Lint JavaScript * Pin govuk-frontend to v4.0.1pull/670/head
Paul Robert Lloyd
3 years ago
committed by
GitHub
15 changed files with 1060 additions and 148 deletions
@ -1,22 +1,23 @@ |
|||||||
// This file is automatically compiled by Webpack, along with any other files
|
// This file is automatically compiled by Webpack, along with any other files
|
||||||
// present in this directory. You're encouraged to place your actual application logic in
|
// present in this directory. You're encouraged to place your actual application
|
||||||
// a relevant structure within app/javascript and only use these pack files to reference
|
// logic in a relevant structure within app/javascript and only use these pack
|
||||||
// that code so it'll be compiled.
|
// files to reference that code so it'll be compiled.
|
||||||
|
|
||||||
// Polyfills for IE
|
// Polyfills for IE
|
||||||
import "@webcomponents/webcomponentsjs" |
import '@webcomponents/webcomponentsjs' |
||||||
import "core-js/stable" |
import 'core-js/stable' |
||||||
import "regenerator-runtime/runtime" |
import 'regenerator-runtime/runtime' |
||||||
import "@stimulus/polyfills" |
import '@stimulus/polyfills' |
||||||
import "custom-event-polyfill" |
import 'custom-event-polyfill' |
||||||
import "intersection-observer" |
import 'intersection-observer' |
||||||
|
|
||||||
//
|
//
|
||||||
|
import GOVUKFrontend from 'govuk-frontend' |
||||||
|
import GOVUKPrototypeComponents from 'govuk-prototype-components' |
||||||
|
import './styles/application.scss' |
||||||
|
import './controllers' |
||||||
|
|
||||||
require.context("govuk-frontend/govuk/assets") |
require.context('govuk-frontend/govuk/assets') |
||||||
import GOVUKFrontend from "govuk-frontend" |
|
||||||
import GOVUKPrototypeComponents from "govuk-prototype-components" |
|
||||||
import "./styles/application.scss" |
|
||||||
import "./controllers" |
|
||||||
|
|
||||||
GOVUKFrontend.initAll() |
GOVUKFrontend.initAll() |
||||||
GOVUKPrototypeComponents.initAll() |
GOVUKPrototypeComponents.initAll() |
||||||
|
@ -1,13 +1,13 @@ |
|||||||
import { Controller } from "@hotwired/stimulus" |
import { Controller } from '@hotwired/stimulus' |
||||||
|
|
||||||
export default class extends Controller { |
export default class extends Controller { |
||||||
initialize() { |
initialize () { |
||||||
this.clearIfHidden() |
this.clearIfHidden() |
||||||
} |
} |
||||||
|
|
||||||
clearIfHidden() { |
clearIfHidden () { |
||||||
if(this.element.style["display"] == "none") { |
if (this.element.style.display === 'none') { |
||||||
this.element.value = "" |
this.element.value = '' |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
|
@ -1,22 +1,22 @@ |
|||||||
// Load all the controllers within this directory and all subdirectories.
|
// Load all the controllers within this directory and all subdirectories.
|
||||||
// Controller files must be named *_controller.js.
|
// Controller files must be named *_controller.js.
|
||||||
|
|
||||||
import { application } from "./application" |
import { application } from './application' |
||||||
|
|
||||||
import AccessibleAutocompleteController from "./accessible_autocomplete_controller.js" |
import AccessibleAutocompleteController from './accessible_autocomplete_controller.js' |
||||||
application.register("accessible-autocomplete", AccessibleAutocompleteController) |
|
||||||
|
|
||||||
import ConditionalFilterController from "./conditional_filter_controller.js" |
import ConditionalFilterController from './conditional_filter_controller.js' |
||||||
application.register("conditional-filter", ConditionalFilterController) |
|
||||||
|
|
||||||
import ConditionalQuestionController from "./conditional_question_controller.js" |
import ConditionalQuestionController from './conditional_question_controller.js' |
||||||
application.register("conditional-question", ConditionalQuestionController) |
|
||||||
|
|
||||||
import GovukfrontendController from "./govukfrontend_controller.js" |
import GovukfrontendController from './govukfrontend_controller.js' |
||||||
application.register("govukfrontend", GovukfrontendController) |
|
||||||
|
|
||||||
import NumericQuestionController from "./numeric_question_controller.js" |
import NumericQuestionController from './numeric_question_controller.js' |
||||||
application.register("numeric-question", NumericQuestionController) |
|
||||||
|
|
||||||
import FilterLayoutController from "./filter_layout_controller.js" |
import FilterLayoutController from './filter_layout_controller.js' |
||||||
application.register("filter-layout", FilterLayoutController) |
application.register('accessible-autocomplete', AccessibleAutocompleteController) |
||||||
|
application.register('conditional-filter', ConditionalFilterController) |
||||||
|
application.register('conditional-question', ConditionalQuestionController) |
||||||
|
application.register('govukfrontend', GovukfrontendController) |
||||||
|
application.register('numeric-question', NumericQuestionController) |
||||||
|
application.register('filter-layout', FilterLayoutController) |
||||||
|
Loading…
Reference in new issue