Sha256: b27f08daf21bb1e114a6a2a5232cdefeddde575ad0e2b2a29f3746a766f97aa9

Contents?: true

Size: 758 Bytes

Versions: 2

Compression:

Stored size: 758 Bytes

Contents

var Footnotes = function() {
  function hideAll() {}
  
  function hideAllAndToggle(id) {
    var el = get(id)
    var display = el.style.display
    Footnotes.hideAll();
    toggle(id, display)
  }  
  
  function get(id) {
    return document.getElementById(id);
  }
  
  function toggle(id, display) {
    var el = get(id)
    if (display == null) { display = el.style.display }
    display == 'none' ? show(el) : hide(el)
    location.href = '#footnotes_debug';
  }

  function show(element) {
    element.style.display = 'block'
  }

  function hide(element) {
    element.style.display = 'none'
  }

  return {
    show: show,
    hide: hide,
    get:  get,
    toggle: toggle,
    hideAllAndToggle: hideAllAndToggle,
    multipleNotes: false
  }
}();

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
scharfie-rails-footnotes-3.5.0 lib/rails-footnotes/assets/footnotes.js
scharfie-rails-footnotes-3.4.2 lib/rails-footnotes/assets/footnotes.js