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: ->
return @rs.issues.history(@scope.issueId).then (history) =>
_.each history.results, (historyResult) ->
#If description was modified take only the description_html field
if historyResult.values_diff.description?
historyResult.values_diff.description = historyResult.values_diff.description_html
for item in history.results
# If description was modified take only the description_html field
if item.values_diff.description?
item.values_diff.description = historyResult.values_diff.description_html
delete historyResult.values_diff.description_html
delete historyResult.values_diff.description_diff
delete item.values_diff.description_html
delete item.values_diff.description_diff
@scope.history = history.results
@scope.comments = _.filter(history.results, (historyEntry) -> historyEntry.comment != "")
@scope.comments = _.filter(history.results, (item) -> item.comment != "")
loadInitialData: ->
params = {