From d5421e38ee7fe8577a611d0f240a1032266fb0ed Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 17 Aug 2015 17:36:52 +0200 Subject: [PATCH] Improved error handling. --- .../javascripts/app/controllers/_profile/devices.js.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/app/controllers/_profile/devices.js.coffee b/app/assets/javascripts/app/controllers/_profile/devices.js.coffee index b5fcba939..830397831 100644 --- a/app/assets/javascripts/app/controllers/_profile/devices.js.coffee +++ b/app/assets/javascripts/app/controllers/_profile/devices.js.coffee @@ -29,7 +29,9 @@ class Index extends App.Controller delete: (e) => e.preventDefault() - id = $(e.target).closest('a').data('device-id') + id = $(e.target).data('device-id') + if !id + id = $(e.target).closest('a').data('device-id') console.log('ID', id) # get data @ajax(