Replace some _.each by native coffescript for.
parent
80c01d38eb
commit
e4975e3f25
|
@ -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) ->
|
||||
for item in history.results
|
||||
# If description was modified take only the description_html field
|
||||
if historyResult.values_diff.description?
|
||||
historyResult.values_diff.description = historyResult.values_diff.description_html
|
||||
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 = {
|
||||
|
|
Loading…
Reference in New Issue