From 1e0665c21d8026848df7a4ae00d185e4c63912eb Mon Sep 17 00:00:00 2001 From: ONyzhnyk Date: Tue, 18 Dec 2018 20:17:03 +0200 Subject: [PATCH] fixed double send OnDriverDistraction --- app/controller/sdl/Abstract/Controller.js | 6 +++--- app/view/home/controlButtons.js | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/controller/sdl/Abstract/Controller.js b/app/controller/sdl/Abstract/Controller.js index 8f94cac55..25aeb527c 100644 --- a/app/controller/sdl/Abstract/Controller.js +++ b/app/controller/sdl/Abstract/Controller.js @@ -991,13 +991,13 @@ SDL.SDLController = Em.Object.extend( /** * SDL Driver Distraction ON/OFF switcher */ - selectDriverDistraction: function() { - if (SDL.SDLModel.data.driverDistractionState) { + selectDriverDistraction: function(event) { + if (event.currentTarget.checked) { FFW.UI.onDriverDistraction('DD_ON'); } else { FFW.UI.onDriverDistraction('DD_OFF'); } - }.observes('SDL.SDLModel.data.driverDistractionState'), + }, /** * Ondisplay keyboard event handler * Sends notification on SDL Core with changed value diff --git a/app/view/home/controlButtons.js b/app/view/home/controlButtons.js index f947a621e..008a4ea1f 100644 --- a/app/view/home/controlButtons.js +++ b/app/view/home/controlButtons.js @@ -496,8 +496,9 @@ getCurrentDisplayModeClass: function() { classNames: 'driverDistractionControlCheckBox', - checkedBinding: 'SDL.SDLModel.data.driverDistractionState' - + checkedBinding: 'SDL.SDLModel.data.driverDistractionState', + + change: SDL.SDLController.selectDriverDistraction, } ) }