From e4975e3f2550d4cadf56d7fbf7742af4ceb99a59 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 23 Jul 2014 13:10:01 +0200 Subject: [PATCH] Replace some _.each by native coffescript for. --- app/coffee/modules/issues/detail.coffee | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/coffee/modules/issues/detail.coffee b/app/coffee/modules/issues/detail.coffee index f7091d99..483b2075 100644 --- a/app/coffee/modules/issues/detail.coffee +++ b/app/coffee/modules/issues/detail.coffee @@ -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 = {