Sha256: d183b2a85ddd9ad5c033df56fd186f629418738165cc556e0467ce1a25dfc1cc

Contents?: true

Size: 802 Bytes

Versions: 1

Compression:

Stored size: 802 Bytes

Contents

var Theme = {
  activate: function(name) {
    window.location.hash = 'themes/' + name
    Theme.loadCurrent();
  },
  loadCurrent: function() {
    var hash = window.location.hash;
    if (hash.length > 0) {
      matches = hash.match(/^#themes\/([a-z0-9\-_]+)$/);
      if (matches && matches.length > 1) {
        $('#current-theme').attr('href', '/stylesheets/themes/' + matches[1] + '/style.css');
      } else {
        alert('theme not valid');
      }
    }
  }
}

$().ready(function() {
  Theme.loadCurrent();
  $.localScroll();
  $('.table :checkbox.toggle').each(function(i, toggle) {
    $(toggle).change(function(e) {
      $(toggle).parents('table:first').find(':checkbox:not(.toggle)').each(function(j, checkbox) {
        checkbox.checked = !checkbox.checked;
      })
    });
  });
});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lucasefe-multi_helper-0.0.1 generators/full_layout/templates/_theme_switch.html.erb