From a918c468ec8467e0ac8fdbc7e2a7c76f8ba21d2b Mon Sep 17 00:00:00 2001 From: Jerome Nadaud Date: Wed, 11 Dec 2013 12:33:33 +0100 Subject: [PATCH] [-] BO : FixBug #PSCSX-122 Live module favorite --- .../themes/default/template/controllers/modules/js.tpl | 8 ++++++++ .../themes/default/template/controllers/modules/page.tpl | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/admin-dev/themes/default/template/controllers/modules/js.tpl b/admin-dev/themes/default/template/controllers/modules/js.tpl index 799f285b1..ef165d5c4 100644 --- a/admin-dev/themes/default/template/controllers/modules/js.tpl +++ b/admin-dev/themes/default/template/controllers/modules/js.tpl @@ -315,6 +315,8 @@ var value_pref = el.data('value'); var module_pref = el.data('module'); var action_pref = 'f'; + var total_favorites = parseInt($('#favorite-count').html()); + try { resAjax = $.ajax({ @@ -336,6 +338,12 @@ if (data == 'OK') { el.parent('li').find('.toggle_favorite').toggle(); + + + if (value_pref) + $('#favorite-count').html(total_favorites+1); + else + $('#favorite-count').html(total_favorites-1); } }, diff --git a/admin-dev/themes/default/template/controllers/modules/page.tpl b/admin-dev/themes/default/template/controllers/modules/page.tpl index 73f895cf5..efd10729f 100644 --- a/admin-dev/themes/default/template/controllers/modules/page.tpl +++ b/admin-dev/themes/default/template/controllers/modules/page.tpl @@ -95,7 +95,7 @@ - {l s='Favorites'} {$nb_modules_favorites} + {l s='Favorites'} {$nb_modules_favorites} {l s='All'} {$nb_modules}