Sha256: ceec16d9da76989a6e3a07f7d50eb1485bde1be9191af01b6dd68d5c3a939f41

Contents?: true

Size: 1.9 KB

Versions: 2

Compression:

Stored size: 1.9 KB

Contents

<!-- Type System tabs -->
<script>
  var $tabs, $toggles, ACTIVE_CLASS;

  ACTIVE_CLASS = 'js-is-active';

  $tabs = $("[data-role='tab']");

  $toggles = $tabs.find("[data-role='link']");

  $toggles.on('click', function(event) {
    var $tab, $toggle;
    event.preventDefault();
    $toggle = $(this);
    $tab = $toggle.closest($tabs);
    if (!$tab.hasClass(ACTIVE_CLASS)) {
      $tabs.removeClass(ACTIVE_CLASS);
      return $tab.addClass(ACTIVE_CLASS);
    }
  });
</script>

<!-- Show Code -->
<script>
  $('a.js-show-code').on('click', function(e){
    $(this).hide();
    $(this).siblings('.js-hide-code').css('display', 'inline-block');
    $(this).parent().siblings('.snippets-table').show();
    e.preventDefault();
  })

  $('a.js-hide-code').on('click', function(e) {
    $(this).hide();
    $(this).siblings('.js-show-code').css("display", "inline-block");
    $(this).parent().siblings('.snippets-table').hide();
    e.preventDefault();
  });
</script>

<!-- Copy Code -->
<script>
  $(document).ready( function() {
    client = new ZeroClipboard($('.copy-source'), {moviePath: '/images/ZeroClipboard.swf'})
    client.on('dataRequested', function(client, args) {
      if ($(this).hasClass("copy-coffee")) {
        var cell = $(this).parents("tr").find("td.snippet").last();
      } else {
        var cell = $(this).parents("td.snippet");
      }

      var code = cell.children("pre").text();
      client.setText(code);
    });
  });
</script>

<script>
  $(document).ready(function(){

    $('.js-menu-trigger-refills').on('click touchstart', function(e){
      $('.er_toc').toggleClass('is-visible');
      $('.js-menu-screen-refills').toggleClass('is-visible');
      e.preventDefault();
    });

    $('.js-menu-screen-refills').on('click touchstart', function(e){
      $('.er_toc').toggleClass('is-visible');
      $('.js-menu-screen-refills').toggleClass('is-visible');
      e.preventDefault();
    });
  });
</script>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
refills-0.2.0 source/refills-page-scripts.html.erb
refills-0.1.0 source/refills-page-scripts.html.erb