diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2014-06-30 14:15:22 +0600 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2014-06-30 14:15:31 +0600 |
commit | 17a0dd83db4d1170a643c92bd08d8b5c648eca8c (patch) | |
tree | d15633c17017c26f47774d62ef596eac93f5dbd4 /sonar-server/src/main/coffee/issues | |
parent | dbc1240fd9aa92f7073cd85ddf47741f08a25043 (diff) | |
download | sonarqube-17a0dd83db4d1170a643c92bd08d8b5c648eca8c.tar.gz sonarqube-17a0dd83db4d1170a643c92bd08d8b5c648eca8c.zip |
SONAR-5209 Speed up issues rendering
Diffstat (limited to 'sonar-server/src/main/coffee/issues')
-rw-r--r-- | sonar-server/src/main/coffee/issues/issue-view.coffee | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/sonar-server/src/main/coffee/issues/issue-view.coffee b/sonar-server/src/main/coffee/issues/issue-view.coffee index 5e6ceb5e06e..e69aad37eec 100644 --- a/sonar-server/src/main/coffee/issues/issue-view.coffee +++ b/sonar-server/src/main/coffee/issues/issue-view.coffee @@ -57,8 +57,8 @@ define [ 'click .code-issue-toggle': 'toggleCollapsed', - 'click [href=#tab-issue-rule]': 'fetchRule', - 'click [href=#tab-issue-changelog]': 'fetchChangeLog', + 'click [href=#tab-issue-rule]': 'showRuleTab', + 'click [href=#tab-issue-changelog]': 'showChangeLogTab', 'click #issue-comment': 'comment', 'click .issue-comment-edit': 'editComment', @@ -72,8 +72,6 @@ define [ onRender: -> - @$('.code-issue-details').tabs() - @$('.code-issue-form').hide() @rule = new Rule key: this.model.get('rule') @ruleRegion.show new RuleView model: @rule, issue: @model @changeLog = new ChangeLog() @@ -97,17 +95,34 @@ define [ toggleCollapsed: -> @$('.code-issue').toggleClass 'code-issue-collapsed' - @fetchRule() + unless @$('.code-issue').is '.code-issue-collapsed' + @showRuleTab() + + + hideTabs: -> + @$('.js-tab-link').removeClass 'active-link' + @$('.js-tab').hide() + + + showTab: (tab) -> + @hideTabs() + s = "#tab-issue-#{tab}" + @$(s).show() + @$("[href=#{s}]").addClass 'active-link' - fetchRule: -> + showRuleTab: (e) -> + e?.preventDefault() + @showTab 'rule' unless @rule.has 'name' @$('#tab-issue-rule').addClass 'navigator-fetching' @rule.fetch success: => @$('#tab-issue-rule').removeClass 'navigator-fetching' - fetchChangeLog: -> + showChangeLogTab: (e) -> + e?.preventDefault() + @showTab 'changelog' unless @changeLog.length > 0 @$('#tab-issue-changeLog').addClass 'navigator-fetching' @changeLog.fetch |