From 28b5bb6cf72a86afc92109c01626f942b2294d40 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 29 Nov 2012 20:47:39 +0100 Subject: [PATCH] Removed not needed forEach(). IE8 is not supporting this. --- .../controllers/_application_controller_form.js.coffee | 3 +-- .../javascripts/app/controllers/navigation.js.coffee | 8 +++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/app/controllers/_application_controller_form.js.coffee b/app/assets/javascripts/app/controllers/_application_controller_form.js.coffee index 6756fe7c9..f05dbe36b 100644 --- a/app/assets/javascripts/app/controllers/_application_controller_form.js.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller_form.js.coffee @@ -528,7 +528,7 @@ class App.ControllerForm extends App.Controller # build options list _buildOptionList: (list, attribute) -> - list.forEach( (item) => + for item in list # if active or if active doesn't exist if item.active || !( 'active' of item ) @@ -542,7 +542,6 @@ class App.ControllerForm extends App.Controller value: item.id, note: item.note, } - ) # execute filter _filterOption: (attribute) -> diff --git a/app/assets/javascripts/app/controllers/navigation.js.coffee b/app/assets/javascripts/app/controllers/navigation.js.coffee index b9dd72aff..443dd05af 100644 --- a/app/assets/javascripts/app/controllers/navigation.js.coffee +++ b/app/assets/javascripts/app/controllers/navigation.js.coffee @@ -157,10 +157,9 @@ class App.Navigation extends App.Controller if !roles && item.role match = _.include( item.role, 'Anybody' ) if roles - roles.forEach( (role) => + for role in roles if !match - match = _.include(item.role, role.name) - ) + match = _.include( item.role, role.name ) if match level1.push item @@ -178,10 +177,9 @@ class App.Navigation extends App.Controller if !roles match = _.include( itemSub.role, 'Anybody' ) if roles - roles.forEach( (role) => + for role in roles if !match match = _.include( itemSub.role, role.name ) - ) if match dropdown[ item.parent ].push itemSub