issues.forEach (issue) =>
line = issue.line || 0
line = 0 if issue.resolution == 'FIXED' || issue.resolution == 'REMOVED'
- row = @$("[data-line-number=#{line}]")
+ row = @$("##{@cid}-#{line}")
unless row.length > 0
line = 0
- row = @$("[data-line-number=#{line}]")
+ row = @$("##{@cid}-#{line}")
if row.length > 0
row.removeClass 'row-hidden'
container = row.children('.line')
serializeData: ->
+ uid: @cid
source: @prepareSource()
settings: @options.main.settings.toJSON()
state: @options.main.state.toJSON()
showSettings: @showSettings
component: @options.main.component.toJSON()
columns: @getStatColumnsCount() + 1
- showZeroLine: @showZeroLine()
\ No newline at end of file
+ showZeroLine: @showZeroLine()
'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',
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()
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
<table class="code">
{{#if showZeroLine}}
- <tr class="row row-hidden" data-line-number="0">
+ <tr class="row row-hidden" data-line-number="0" id="{{uid}}-0">
{{#if settings.coverage}}
<td class="stat coverage-tests"></td>
<td class="stat coverage-conditions"></td>
{{#each source}}
{{#if show}}
- <tr class="row"
- data-line-number="{{lineNumber}}">
+ <tr class="row" data-line-number="{{lineNumber}}" id="{{uid}}-{{lineNumber}}">
{{#if ../../settings.scm}}
<td class="stat {{#if scm}}scm{{/if}}">
{{#if author}}<li>{{t 'author'}}: {{author}}</li>{{/if}}
</ul>
- <div class="code-issue-form"></div>
+ <div class="code-issue-form" style="display: none;"></div>
<div class="code-issue-details">
- <ul class="tabs">
+ <ul class="code-issue-tabs">
<li>
- <a href="#tab-issue-rule">{{t 'rule'}}</a>
+ <a class="js-tab-link underlined-link" href="#tab-issue-rule">{{t 'rule'}}</a>
</li>
<li>
- <a href="#tab-issue-changelog">{{t 'changelog'}}</a>
+ <a class="js-tab-link underlined-link" href="#tab-issue-changelog">{{t 'changelog'}}</a>
</li>
</ul>
- <div id="tab-issue-rule">
+ <div id="tab-issue-rule" class="js-tab">
<div class="rule-desc"></div>
</div>
- <div id="tab-issue-changelog"></div>
+ <div id="tab-issue-changelog" class="js-tab"></div>
</div>
</div>
{{/each}}
</div>
-</div>
\ No newline at end of file
+</div>
}
.code-issue-details {
- padding: 0 0 5px;
+ padding: 0 10px 5px;
border-left: 1px solid #DDD;
border-right: 1px solid #DDD;
border-bottom: 1px solid #DDD;
background-color: #EFEFEF;
-}
-
-.code-issue-details .ui-tabs-panel {
- padding: 5px 10px 0;
line-height: 1.3;
}
-.code-issue-details .tabs {
- height: auto;
- padding: 5px 10px;
- border-bottom: 1px solid #DDD;
-}
+.code-issue-tabs {
+ margin-bottom: 5px;
+ font-size: 0;
-.code-issue-details .tabs li + li {
- margin-left: 10px;
-}
+ & > li {
+ display: inline-block;
+ padding: 4px 0;
+ color: @secondFontColor;
+ font-size: @smallFontSize;
+ }
-.code-issue-details .tabs li a:link,
-.code-issue-details .tabs li a:visited {
- float: none;
- margin: 0;
- padding: 0;
+ & > li + li { margin-left: 15px; }
}
.code-issue-details-list {
}
}
+.active-link {
+ border-bottom: none;
+ font-weight: 500;
+}
+
a {
cursor: pointer;
.highlighted-link;