Commit eb99feb4a7e01c4e83203ec014c082205b77ad02
Committed by
Dmitriy Zaporozhets
1 parent
a5ce8696
Exists in
master
and in
4 other branches
simple refactoring
Showing
4 changed files
with
19 additions
and
19 deletions
Show diff stats
app/assets/javascripts/dashboard.js.coffee
| ... | ... | @@ -4,11 +4,11 @@ window.dashboardPage = -> |
| 4 | 4 | event.preventDefault() |
| 5 | 5 | toggleFilter $(this) |
| 6 | 6 | reloadActivities() |
| 7 | - | |
| 7 | + | |
| 8 | 8 | reloadActivities = -> |
| 9 | 9 | $(".content_list").html '' |
| 10 | 10 | Pager.init 20, true |
| 11 | - | |
| 11 | + | |
| 12 | 12 | toggleFilter = (sender) -> |
| 13 | 13 | sender.parent().toggleClass "inactive" |
| 14 | 14 | event_filters = $.cookie("event_filter") |
| ... | ... | @@ -17,11 +17,11 @@ toggleFilter = (sender) -> |
| 17 | 17 | event_filters = event_filters.split(",") |
| 18 | 18 | else |
| 19 | 19 | event_filters = new Array() |
| 20 | - | |
| 20 | + | |
| 21 | 21 | index = event_filters.indexOf(filter) |
| 22 | 22 | if index is -1 |
| 23 | 23 | event_filters.push filter |
| 24 | 24 | else |
| 25 | 25 | event_filters.splice index, 1 |
| 26 | - | |
| 26 | + | |
| 27 | 27 | $.cookie "event_filter", event_filters.join(",") | ... | ... |
app/assets/javascripts/merge_requests.js.coffee
| 1 | 1 | # |
| 2 | 2 | # * Filter merge requests |
| 3 | -# | |
| 3 | +# | |
| 4 | 4 | @merge_requestsPage = -> |
| 5 | 5 | $('#assignee_id').chosen() |
| 6 | 6 | $('#milestone_id').chosen() |
| ... | ... | @@ -8,16 +8,16 @@ |
| 8 | 8 | $(this).closest('form').submit() |
| 9 | 9 | |
| 10 | 10 | class MergeRequest |
| 11 | - | |
| 11 | + | |
| 12 | 12 | constructor: (@opts) -> |
| 13 | 13 | this.$el = $('.merge-request') |
| 14 | 14 | @diffs_loaded = false |
| 15 | 15 | @commits_loaded = false |
| 16 | - | |
| 16 | + | |
| 17 | 17 | this.activateTab(@opts.action) |
| 18 | - | |
| 18 | + | |
| 19 | 19 | this.bindEvents() |
| 20 | - | |
| 20 | + | |
| 21 | 21 | this.initMergeWidget() |
| 22 | 22 | this.$('.show-all-commits').on 'click', => |
| 23 | 23 | this.showAllCommits() |
| ... | ... | @@ -28,7 +28,7 @@ class MergeRequest |
| 28 | 28 | |
| 29 | 29 | initMergeWidget: -> |
| 30 | 30 | this.showState( @opts.current_state ) |
| 31 | - | |
| 31 | + | |
| 32 | 32 | if this.$('.automerge_widget').length and @opts.check_enable |
| 33 | 33 | $.get @opts.url_to_automerge_check, (data) => |
| 34 | 34 | this.showState( data.state ) |
| ... | ... | @@ -42,12 +42,12 @@ class MergeRequest |
| 42 | 42 | bindEvents: -> |
| 43 | 43 | this.$('.nav-tabs').on 'click', 'a', (event) => |
| 44 | 44 | a = $(event.currentTarget) |
| 45 | - | |
| 45 | + | |
| 46 | 46 | href = a.attr('href') |
| 47 | 47 | History.replaceState {path: href}, document.title, href |
| 48 | - | |
| 48 | + | |
| 49 | 49 | event.preventDefault() |
| 50 | - | |
| 50 | + | |
| 51 | 51 | this.$('.nav-tabs').on 'click', 'li', (event) => |
| 52 | 52 | this.activateTab($(event.currentTarget).data('action')) |
| 53 | 53 | ... | ... |
spec/factories/user_team_project_relationships.rb
spec/factories/user_team_user_relationships.rb