Sha256: 705f903ce7a9640ce2a2a3536e8615a126005e3b8ccc16a3c2dfb677c25a07a4

Contents?: true

Size: 817 Bytes

Versions: 26

Compression:

Stored size: 817 Bytes

Contents

Ext.ns("Knitkit.Helpers");

Knitkit.Helpers.toggleArchivableContent = function(archiveToggle, name){
  var current_items = document.getElementsByClassName(name+'_current');
  var archived_items = document.getElementsByClassName(name+'_archived');
  var i = null;

  if (archiveToggle.innerHTML == 'Show Archived'){
    for (i = 0; i < current_items.length; i++) {
      current_items[i].style.display='none';
    }
    for (i = 0; i < archived_items.length; i++){
      archived_items[i].style.display='';
    }
    archiveToggle.innerHTML = 'Show Current';
  }else{
    for (i = 0; i < archived_items.length; i++){
      archived_items[i].style.display='none';
    }
    for (i = 0; i < current_items.length; i++){
      current_items[i].style.display='';
    }
    archiveToggle.innerHTML = 'Show Archived';
  }
}

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
knitkit-2.1.15 public/javascripts/knitkit/helpers.js
knitkit-2.1.14 public/javascripts/knitkit/helpers.js
knitkit-2.1.13 public/javascripts/knitkit/helpers.js
knitkit-2.1.12 public/javascripts/knitkit/helpers.js
knitkit-2.1.11 public/javascripts/knitkit/helpers.js
knitkit-2.1.10 public/javascripts/knitkit/helpers.js
knitkit-2.1.9 public/javascripts/knitkit/helpers.js
knitkit-2.1.8 public/javascripts/knitkit/helpers.js
knitkit-2.1.7 public/javascripts/knitkit/helpers.js
knitkit-2.1.6 public/javascripts/knitkit/helpers.js
knitkit-2.1.5 public/javascripts/knitkit/helpers.js
knitkit-2.1.4 public/javascripts/knitkit/helpers.js
knitkit-2.1.3 public/javascripts/knitkit/helpers.js
knitkit-2.1.2 public/javascripts/knitkit/helpers.js
knitkit-2.1.1 public/javascripts/knitkit/helpers.js
knitkit-2.1.0 public/javascripts/knitkit/helpers.js
knitkit-2.0.11 public/javascripts/knitkit/helpers.js
knitkit-2.0.10 public/javascripts/knitkit/helpers.js
knitkit-2.0.9 public/javascripts/knitkit/helpers.js
knitkit-2.0.7 public/javascripts/knitkit/helpers.js