From 6ab4344187510bb6b7a194c1a7c22e2f412a4d36 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Fri, 15 Jul 2016 20:21:25 +0200 Subject: [PATCH] Corrected initialization problem with CategoriesHelper instance. --- src/assets/js/backend_services.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/assets/js/backend_services.js b/src/assets/js/backend_services.js index 6547e784..0f47afed 100644 --- a/src/assets/js/backend_services.js +++ b/src/assets/js/backend_services.js @@ -29,6 +29,9 @@ window.BackendServices = window.BackendServices || {}; */ var helper; + var servicesHelper = new ServicesHelper(); + var categoriesHelper = new CategoriesHelper(); + /** * Default initialize method of the page. * @@ -80,10 +83,10 @@ window.BackendServices = window.BackendServices || {}; if ($(this).hasClass('services-tab')) { // display services tab $('#services').show(); - helper = new ServicesHelper(); + helper = servicesHelper; } else if ($(this).hasClass('categories-tab')) { // display categories tab $('#categories').show(); - helper = new CategoriesHelper(); + helper = categoriesHelper; } helper.resetForm(); @@ -92,11 +95,8 @@ window.BackendServices = window.BackendServices || {}; Backend.placeFooterToBottom(); }); - helper.bindEventHandlers(); - - // @todo Bind and unbind the events dynamically on tab click. - var tmpHelper = new CategoriesHelper(); - tmpHelper.bindEventHandlers(); + servicesHelper.bindEventHandlers(); + categoriesHelper.bindEventHandlers(); } /**