Explorar el Código

update ajax notifications in menu.tpl

Alex Aragón hace 6 años
padre
commit
a08ec978ec
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  1. 3 2
      main/template/default/layout/menu.tpl

+ 3 - 2
main/template/default/layout/menu.tpl

@@ -3,11 +3,12 @@
     <script>
         $(document).ready(function () {
             $.get('{{ _p.web_main }}inc/ajax/message.ajax.php?a=get_count_message', function(data) {
-                if (data === '0') {
+                var countNotifications = (data.ms_friends + data.ms_groups + data.ms_inbox);
+                if (countNotifications === 0 ) {
                     $("#count_message_li").addClass('hidden');
                 } else {
                     $("#count_message_li").removeClass('hidden');
-                    $("#count_message").append(data);
+                    $("#count_message").append(countNotifications);
                 }
             });
         });