Replace some _.each by native coffescript for.

stable
Andrey Antukh 2014-07-23 13:10:01 +02:00
parent 80c01d38eb
commit e4975e3f25
1 changed files with 7 additions and 7 deletions

View File

@ -80,16 +80,16 @@ class IssueDetailController extends mixOf(taiga.Controller, taiga.PageMixin)
loadHistory: -> loadHistory: ->
return @rs.issues.history(@scope.issueId).then (history) => return @rs.issues.history(@scope.issueId).then (history) =>
_.each history.results, (historyResult) -> for item in history.results
#If description was modified take only the description_html field # If description was modified take only the description_html field
if historyResult.values_diff.description? if item.values_diff.description?
historyResult.values_diff.description = historyResult.values_diff.description_html item.values_diff.description = historyResult.values_diff.description_html
delete historyResult.values_diff.description_html delete item.values_diff.description_html
delete historyResult.values_diff.description_diff delete item.values_diff.description_diff
@scope.history = history.results @scope.history = history.results
@scope.comments = _.filter(history.results, (historyEntry) -> historyEntry.comment != "") @scope.comments = _.filter(history.results, (item) -> item.comment != "")
loadInitialData: -> loadInitialData: ->
params = { params = {