Source: scripts/full-spa.js

// This is a no-jquery version of full.js
// for use with single-page apps such as AMS.
// In time, all components will be moved over
// and this will become full.js.

// Global
//= require "helper/_globals.js"

// Utilities
//= require "utilities.js"

// Helper
//= require "helper/_environments.js"
//= require "helper/_features.js"
//= require "helper/_feedback.js"
//= require "helper/_transitions.js"
//= require "helper/_focus.js"
//= require "helper/_size.js"
//= require "helper/_user.js"

// Components
//= require "buttons/_multiple-action-button"
//= require "content/_content-halves"
//= require "forms/_form-help"
//= require "forms/_form-input-range"
//= require "forms/_password-toggle"
//= require "forms/_toggle-help"
//= require "forms/options-bar/_options-bar"
//= require "navigation/breadcrumb/_breadcrumb"
//= require "header/_header"
//= require "help/floating-help/_floating-help"
//= require "images/_lazy-images"
//= require "messages/_messages"
//= require "navigation/product-nav/_product-nav"
//= require "spinners/_spinners"
//= require "navigation/sticky-nav/_sticky-nav"
//= require "widgets/accordion/_accordion"
//= require "widgets/modal/_modal-v5"
//= require "sticky-container/_sticky-container"

// UCASDesignFramework
// This initialises all the supplied plugins
// and should be the last item in this file.
// Initialise all framework plugins.

/* global UCASUtilities */

'use strict'

/**
 * @public Global UCASDesignFramework object.
 */
var UCASDesignFramework = UCASDesignFramework || {};

(function (global, _u) {
  /**
   * Initialise modules.
   * @param {object} context
   */
  function attach (context) {
    context = context || document
    // Initialise all modules that have the initOnLoad property set to true.
    _u.forEach(Object.keys(global), function (i, el) {
      var module = global[el]
      if (module.initOnLoad && module.init && typeof module.init === 'function') {
        module.init(context)
      }
      if (module.addSubscriptions === true && global.bus) {
        global.subscriptions.addSubscriptions(module, el)
      }
    })
  }

  /**
   * Get ready.
   */
  function ready () {
    if (document.readyState !== 'loading') {
      run()
    } else {
      document.addEventListener('DOMContentLoaded', run)
    }
  }

  /**
   * Go!
   */
  function run () {
    attach(document)
    document.documentElement.setAttribute('data-fulljs', 'loaded')

    // @event designFrameworkReady
    var event = document.createEvent('Event')
    event.initEvent('designFrameworkReady', true, true)
    document.dispatchEvent(event)
  }

  global.attach = attach
  global.ready = ready
})(UCASDesignFramework, UCASUtilities)

UCASDesignFramework.ready()