define [
'backbone.marionette'
'templates/component-viewer'
+ 'source-viewer/popups/scm-popup'
'component-viewer/coverage-popup'
'component-viewer/duplication-popup'
'component-viewer/time-changes-popup'
], (
Marionette
Templates
+ SCMPopupView
CoveragePopupView
DuplicationPopupView
TimeChangesPopupView
'click .js-line-actions': 'highlightLine'
+ 'click .source-line-scm': 'showSCMPopup'
+
'click .source-line-covered': 'showCoveragePopup'
'click .source-line-partially-covered': 'showCoveragePopup'
'click .source-line-uncovered': 'showCoveragePopup'
row.toggleClass 'component-viewer-header-full'
+ showSCMPopup: (e) ->
+ e.stopPropagation()
+ $('body').click()
+ line = +$(e.currentTarget).closest('[data-line-number]').data 'line-number'
+ row = _.findWhere @options.main.source.get('formattedSource'), lineNumber: line
+ popup = new SCMPopupView
+ triggerEl: $(e.currentTarget)
+ model: new Backbone.Model
+ scmAuthor: row.scm.author
+ scmDate: row.scm.date
+ popup.render()
+
+
showCoveragePopup: (e) ->
e.stopPropagation()
$('body').click()
<td class="source-meta {{#if scm}}source-line-scm{{/if}}">
{{#if scm}}
{{#ifSCMChanged ../../../../source ../../../lineNumber}}
- <div class="source-line-scm-inner" title="{{scm.author}}
{{dt scm.date}}" data-author="{{scm.author}}"></div>
+ <div class="source-line-scm-inner" data-author="{{scm.author}}"></div>
{{/ifSCMChanged}}
{{/if}}
</td>
<td class="source-meta source-line-scm" {{#if line}}data-line-number="{{line}}"{{/if}}>
{{#ifSCMChanged2 ../source line}}
- <div class="source-line-scm-inner" title="{{scmAuthor}} {{scmDate}}" data-author="{{scmAuthor}}"></div>
+ <div class="source-line-scm-inner" data-author="{{scmAuthor}}"></div>
{{/ifSCMChanged2}}
</td>