Sha256: 5a9a57b91f8503828827f7ea7d4b26e8cf4a30523f1116e582b370b4691162a9

Contents?: true

Size: 949 Bytes

Versions: 176

Compression:

Stored size: 949 Bytes

Contents

// = require govuk_publishing_components/vendor/magna-charta.min

window.GOVUK = window.GOVUK || {};

(function (GOVUK, $) {
  'use strict'

  var BarchartEnhancement = function ($element) {
    this.$element = $element
  }

  BarchartEnhancement.prototype.init = function () {
    // the not selectors are protection against initialising twice since that
    // causes quite a mess. The not .mc-chart is because it creates a second
    // .js-barchart-table element with .mc-chart and then the
    // .js-barchart-table-init is given when we initialise
    var $barcharts = this.$element.find('.js-barchart-table:not(.mc-chart):not(.js-barchart-table-init)')
    $barcharts.each(function () {
      var $table = $(this)
      $.magnaCharta($table, { toggleText: 'Change between chart and table' })
      $table.addClass('js-barchart-table-init')
    })
  }

  GOVUK.GovspeakBarchartEnhancement = BarchartEnhancement
}(window.GOVUK, window.jQuery))

Version data entries

176 entries across 176 versions & 1 rubygems

Version Path
govuk_publishing_components-21.63.2 app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js
govuk_publishing_components-21.63.1 app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js
govuk_publishing_components-21.63.0 app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js
govuk_publishing_components-21.62.0 app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js
govuk_publishing_components-21.61.0 app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js
govuk_publishing_components-21.60.3 app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js
govuk_publishing_components-21.60.2 app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js
govuk_publishing_components-21.60.1 app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js
govuk_publishing_components-21.60.0 app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js
govuk_publishing_components-21.59.0 app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js
govuk_publishing_components-21.58.0 app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js
govuk_publishing_components-21.57.1 app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js
govuk_publishing_components-21.57.0 app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js
govuk_publishing_components-21.56.2 app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js
govuk_publishing_components-21.56.1 app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js
govuk_publishing_components-21.56.0 app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js
govuk_publishing_components-21.55.4 app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js
govuk_publishing_components-21.55.3 app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js
govuk_publishing_components-21.55.2 app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js
govuk_publishing_components-21.55.1 app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js