function SubsectionToggleClick (subsectionView, event) {
      var that = this

      this.$target = $(event.target)

      this.track = function () {
        track('pageElementInteraction', that._trackingAction(), { label: that._trackingLabel() })
      }

      this._trackingAction = function () {
        return (subsectionView.isClosed() ? 'accordionClosed' : 'accordionOpened')
      }

      this._trackingLabel = function () {
        if (that._clickedOnIcon()) {
          return subsectionView.title + ' - ' + that._iconType() + ' Click'
        } else if (that._clickedOnHeading()) {
          return subsectionView.title + ' - Heading Click'
        } else {
          return subsectionView.title + ' - Click Elsewhere'
        }
      }

      this._clickedOnIcon = function () {
        return that.$target.hasClass('subsection__icon')
      }

      this._clickedOnHeading = function () {
        return that.$target.hasClass('js-subsection-button')
      }

      this._iconType = function () {
        return (subsectionView.isClosed() ? 'Minus' : 'Plus')
      }
    }
// depending on which part of the subsection the user clicked.
depending on which part of the subsection the user clicked.
depending on which part of the subsection the user clicked .
function SubsectionToggleClick (subsectionView, event) {
      var that = this
      this.$target = $(event.target)
      this.track = function () {
        track('pageElementInteraction', that._trackingAction(), { label: that._trackingLabel() })
      }
      this._trackingAction = function () {
        return (subsectionView.isClosed() ? 'accordionClosed' : 'accordionOpened')
      }
      this._trackingLabel = function () {
        if (that._clickedOnIcon()) {
          return subsectionView.title + ' - ' + that._iconType() + ' Click'
        } else if (that._clickedOnHeading()) {
          return subsectionView.title + ' - Heading Click'
        } else {
          return subsectionView.title + ' - Click Elsewhere'
        }
      }
      this._clickedOnIcon = function () {
        return that.$target.hasClass('subsection__icon')
      }
      this._clickedOnHeading = function () {
        return that.$target.hasClass('js-subsection-button')
      }
      this._iconType = function () {
        return (subsectionView.isClosed() ? 'Minus' : 'Plus')
      }
    }
function SubsectionToggleClick ( subsectionView , event ) { var that = this this . $target = $ ( event . target ) this . track = function ( ) { track ( 'pageElementInteraction' , that . _trackingAction ( ) , { label : that . _trackingLabel ( ) } ) } this . _trackingAction = function ( ) { return ( subsectionView . isClosed ( ) ? 'accordionClosed' : 'accordionOpened' ) } this . _trackingLabel = function ( ) { if ( that . _clickedOnIcon ( ) ) { return subsectionView . title + ' - ' + that . _iconType ( ) + ' Click' } else if ( that . _clickedOnHeading ( ) ) { return subsectionView . title + ' - Heading Click' } else { return subsectionView . title + ' - Click Elsewhere' } } this . _clickedOnIcon = function ( ) { return that . $target . hasClass ( 'subsection__icon' ) } this . _clickedOnHeading = function ( ) { return that . $target . hasClass ( 'js-subsection-button' ) } this . _iconType = function ( ) { return ( subsectionView . isClosed ( ) ? 'Minus' : 'Plus' ) } }
depending on which part of the subsection the user clicked.
depending on which part of the subsection the user clicked .