From 395b2cb0acc63f2616f95fddb3dcee4892600edb Mon Sep 17 00:00:00 2001 From: Robert Axelsen Date: Mon, 10 Jul 2017 12:00:29 +0200 Subject: [PATCH] TT#18002 Csc fix notifications bug in cb modules What has been done: 1. Fix "CB only" bug with notification box with 'showmessage' event always moving a little to the right for eache subsequent success message (showmessage state true) called inside store.sync() method Change-Id: I28716f0054331cf9bf124abb00f08825d9950ca7 --- .../pages/callblocking/CallBlockingController.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/classic/src/view/pages/callblocking/CallBlockingController.js b/classic/src/view/pages/callblocking/CallBlockingController.js index ecbcafb4..8609df68 100644 --- a/classic/src/view/pages/callblocking/CallBlockingController.js +++ b/classic/src/view/pages/callblocking/CallBlockingController.js @@ -133,6 +133,10 @@ Ext.define('NgcpCsc.view.pages.callblocking.CallBlockingController', { }; }, + addSuccessful: function () { + this.fireEvent('showmessage', true, Ngcp.csc.locales.common.add_success[localStorage.getItem('languageSelected')]); + }, + addToStore: function(newNumber, newId, store) { var me = this; var view = this.getView(); @@ -140,19 +144,18 @@ Ext.define('NgcpCsc.view.pages.callblocking.CallBlockingController', { "block_list": newNumber, "enabled": true }); + var successState = false; store.add(cbModel); view.fireEvent('cardContainerResized', view); store.sync({ - success: function() { - me.fireEvent('showmessage', true, Ngcp.csc.locales.common.add_success[localStorage.getItem('languageSelected')]); - }, - failure: function() { - me.fireEvent('showmessage', false, Ngcp.csc.locales.common.save_unsuccess[localStorage.getItem('languageSelected')]); - }, callback: function() { store.commitChanges(); } }); + // Workaround, as calling addSuccessful() here solved the issue with + // notification box "moving towards the left for every new showmessages + // event", which happened only insidestore.sync() callbacks. + me.addSuccessful(); }, getCallBlockingStoreName: function(currentRoute) {