Sha256: 8a1f87dec4604aaf2ecf908111a567d17d8a717567b2ba36bff52ae821522696

Contents?: true

Size: 883 Bytes

Versions: 19

Compression:

Stored size: 883 Bytes

Contents


$(function () {

  console.log('Loaded wco/collapse-expand.js')

  $(".collapse-expand").each(function() {
    const thisId = $(this).attr('id')
    if (thisId) {
      const state = localStorage.getItem("collapse-expand#"+thisId)
      if (state === 'collapsed') {
        $(this).next().slideToggle()
        $(this).addClass('wco-collapse')
      }
    }
  })
  $(".collapse-expand").click(function (_e) {
    const thisId = $(this).attr('id')
    const state = localStorage.getItem("collapse-expand#"+thisId)
    if (state === 'collapsed') {
      localStorage.removeItem("collapse-expand#"+thisId)
      $(this).removeClass('wco-collapse')
    } else {
      localStorage.setItem("collapse-expand#"+thisId, "collapsed")
      $(this).addClass('wco-collapse')
    }
    $(this).next().slideToggle();
  }).children().click(function (e) {
    e.stopPropagation()
  })

}); // END

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
wco_models-3.1.0.56 app/assets/javascripts/wco/collapse-expand.js
wco_models-3.1.0.55 app/assets/javascripts/wco/collapse-expand.js
wco_models-3.1.0.54 app/assets/javascripts/wco/collapse-expand.js
wco_models-3.1.0.53 app/assets/javascripts/wco/collapse-expand.js
wco_models-3.1.0.52 app/assets/javascripts/wco/collapse-expand.js
wco_models-3.1.0.51 app/assets/javascripts/wco/collapse-expand.js
wco_models-3.1.0.50 app/assets/javascripts/wco/collapse-expand.js
wco_models-3.1.0.49 app/assets/javascripts/wco/collapse-expand.js
wco_models-3.1.0.48 app/assets/javascripts/wco/collapse-expand.js
wco_models-3.1.0.47 app/assets/javascripts/wco/collapse-expand.js
wco_models-3.1.0.46 app/assets/javascripts/wco/collapse-expand.js
wco_models-3.1.0.45 app/assets/javascripts/wco/collapse-expand.js
wco_models-3.1.0.44 app/assets/javascripts/wco/collapse-expand.js
wco_models-3.1.0.43 app/assets/javascripts/wco/collapse-expand.js
wco_models-3.1.0.42 app/assets/javascripts/wco/collapse-expand.js
wco_models-3.1.0.41 app/assets/javascripts/wco/collapse-expand.js
wco_models-3.1.0.40 app/assets/javascripts/wco/collapse-expand.js
wco_models-3.1.0.39 app/assets/javascripts/wco/collapse-expand.js
wco_models-3.1.0.38 app/assets/javascripts/wco/collapse-expand.js