Sha256: 9e620a110bc9dc66682a3740374de7208a6ad3cb2c885689fa74f95947a7c274

Contents?: true

Size: 1.54 KB

Versions: 24

Compression:

Stored size: 1.54 KB

Contents

FORGE.features.mainMenu = {
  init: function () {
    $("#menu").on("click", ".normal .arrow", function () {
      var $arrow = $(this),
          klass = $arrow.attr("class").split(" ")[0],
          status = $arrow.attr("class").split(" ")[2];
      $(".forge_submenu." + klass).slideToggle(200);
      if (status === "hide") {
        $arrow.removeClass("hide");
        $arrow.addClass("show");
      } else {
        $arrow.removeClass("show");
        $arrow.addClass("hide");
      }
    });




    // old forge menu
    $('[class=forge-menu-link-wrap]').hover(
      function() { $(this).find('.hover').fadeIn(); },
      function() {
        $(this).find('.hover').fadeOut();
        $(this).find('.press').fadeOut();
      }
    );

    $('.forge-menu-link-wrap').mousedown(function() {
      $(this).find('.press').fadeIn(80);
    });

    $('.forge-menu-link-wrap .forge-menu-link.press').mouseup(function() {
      $(this).find('.press').fadeOut(80);
      window.location = $(this).find('a').attr('href');
    });

    $(".forge-submenu-link.normal a").click( function() {
      $(".forge_submenu." + $(this).attr("class")).slideToggle("fast");
      // rotate arrow
      if ($(".forge-submenu-link.normal ." + $(this).attr("class") + " img").attr("src") == "<%= asset_path 'forge/menu-arrow-down.png' %>") { var arrow_image = "<%= asset_path 'forge/menu-arrow.png' %>" } else { var arrow_image = "<%= asset_path 'forge/menu-arrow-down.png' %>" }
      $(".forge-submenu-link.normal ." + $(this).attr("class") + " img").attr("src", arrow_image);
    });
  }
}

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
forge-cli-0.1.10 lib/forge/app/assets/javascripts/forge/features/main_menu.js.erb
forge-cli-0.1.9 lib/forge/app/assets/javascripts/forge/features/main_menu.js.erb
forge-cli-0.1.8 lib/forge/lib/assets/javascripts/forge/features/main_menu.js.erb
forge-cli-0.1.7 lib/forge/lib/assets/javascripts/forge/features/main_menu.js.erb
forge-cli-0.1.6 lib/forge/lib/assets/javascripts/forge/features/main_menu.js.erb
forge-cli-0.1.5 lib/forge/lib/assets/javascripts/forge/features/main_menu.js.erb
forge-cli-0.1.4 lib/forge/lib/assets/javascripts/forge/features/main_menu.js.erb
forge-cli-0.1.3 lib/forge/lib/assets/javascripts/forge/features/main_menu.js.erb
forge-cli-0.1.2 lib/forge/lib/assets/javascripts/forge/features/main_menu.js.erb
forge-cli-0.1.1 lib/forge/lib/assets/javascripts/forge/features/main_menu.js.erb
forge-cli-0.1.0 lib/forge/lib/assets/javascripts/forge/features/main_menu.js.erb
forge-cli-0.0.18 lib/forge/lib/assets/javascripts/forge/features/main_menu.js.erb
forge-cli-0.0.17 lib/forge/lib/assets/javascripts/forge/features/main_menu.js.erb
forge-cli-0.0.16 lib/forge/lib/assets/javascripts/forge/features/main_menu.js.erb
forge-cli-0.0.15 lib/forge/lib/assets/javascripts/forge/features/main_menu.js.erb
forge-cli-0.0.14 lib/forge/lib/assets/javascripts/forge/features/main_menu.js.erb
forge-cli-0.0.13 lib/forge/lib/assets/javascripts/forge/features/main_menu.js.erb
forge-cli-0.0.12 lib/forge/lib/assets/javascripts/forge/features/main_menu.js.erb
forge-cli-0.0.11 lib/forge/lib/assets/javascripts/forge/features/main_menu.js.erb
forge-cli-0.0.10 lib/forge/lib/assets/javascripts/forge/features/main_menu.js.erb