application.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // This is a manifest file that'll be compiled into application.js, which will include all the files
  2. // listed below.
  3. //
  4. // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
  5. // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
  6. //
  7. // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
  8. // compiled file.
  9. //
  10. // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
  11. // about supported directives.
  12. //
  13. //= require jquery
  14. //= require jquery_ujs
  15. //= require foundation
  16. //= require jquery.icheck
  17. //= require jquery.cookie
  18. //= require_directory .
  19. $(document).ready(function(){
  20. $(document).foundation();
  21. });
  22. toggleTabs = function(tab, newTab) {
  23. tab.parent().addClass('active').siblings().removeClass('active');
  24. $( $('.tabs').data("tab") + "-content").removeClass('active');
  25. $(newTab + "-content").addClass('active');
  26. $('.tabs').data("tab", newTab);
  27. };
  28. jQuery(document).ready(function($) {
  29. $('.modal-trigger').trigger('click');
  30. $('.tabs').data("tab", "#login");
  31. if (window.location.hash == "#signup") {
  32. toggleTabs($("#signup-tab"), "#signup");
  33. }
  34. $("dd > a").click(function() {
  35. toggleTabs($(this), $(this).data('tab-content'));
  36. });
  37. });