Welcome to mirror list, hosted at ThFree Co, Russian Federation.

project_show.js.coffee « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6828ae471e51426e0c538712dd6b6b68bd1f4904 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class @ProjectShow
  constructor: ->
    $('.project-home-panel .star').on 'ajax:success', (e, data, status, xhr) ->
      $(@).toggleClass('on').find('.count').html(data.star_count)
    .on 'ajax:error', (e, xhr, status, error) ->
      new Flash('Star toggle failed. Try again later.', 'alert')

    $("a[data-toggle='tab']").on "shown.bs.tab", (e) ->
        $.cookie "default_view", $(e.target).attr("href"), { expires: 30, path: '/' }

      defaultView = $.cookie("default_view")
      if defaultView
        $("a[href=" + defaultView + "]").tab "show"
      else
        $("a[data-toggle='tab']:first").tab "show"