Browse Source

Small js fixes

Rafał Pitoń 10 years ago
parent
commit
0f79344adb

+ 1 - 6
misago/static/misago/js/misago-notifications.js

@@ -2,7 +2,7 @@ $(function() {
   var ajax_cache = null;
   var ajax_cache = null;
 
 
   var $container = $('.user-notifications-nav');
   var $container = $('.user-notifications-nav');
-  var $link = $container.children('a');
+  var $link = $container.find('.dropdown-toggle');
 
 
   if (is_authenticated) {
   if (is_authenticated) {
     Misago.Server.on_data("notifications", function(data) {
     Misago.Server.on_data("notifications", function(data) {
@@ -30,7 +30,6 @@ $(function() {
     $display.html(data.html);
     $display.html(data.html);
     $display.show();
     $display.show();
     Misago.DOM.changed();
     Misago.DOM.changed();
-    $link.tooltip('destroy');
   }
   }
 
 
   function fetch_list() {
   function fetch_list() {
@@ -43,17 +42,13 @@ $(function() {
     $display.hide();
     $display.hide();
     $loader.show();
     $loader.show();
     fetch_list();
     fetch_list();
-    $link.tooltip('destroy');
   });
   });
   $container.on('show.bs.dropdown', function () {
   $container.on('show.bs.dropdown', function () {
     if (ajax_cache == null) {
     if (ajax_cache == null) {
       fetch_list();
       fetch_list();
-    } else {
-      $link.tooltip('destroy');
     }
     }
   });
   });
   $container.on('hide.bs.dropdown', function() {
   $container.on('hide.bs.dropdown', function() {
-    Misago.bind_tooltips();
     $container.find('.btn-refresh').hide();
     $container.find('.btn-refresh').hide();
   });
   });
   $container.on('submit', '.read-all-notifications', function() {
   $container.on('submit', '.read-all-notifications', function() {

+ 3 - 1
misago/static/misago/js/misago-tooltips.js

@@ -1,5 +1,6 @@
 // Fancy data-bound tooltips
 // Fancy data-bound tooltips
 $(function() {
 $(function() {
+
   function set_tooltips() {
   function set_tooltips() {
     $('.tooltip-top').tooltip({container: 'body', placement: 'top'});
     $('.tooltip-top').tooltip({container: 'body', placement: 'top'});
     $('.tooltip-bottom').tooltip({container: 'body', placement: 'bottom'});
     $('.tooltip-bottom').tooltip({container: 'body', placement: 'bottom'});
@@ -18,8 +19,9 @@ $(function() {
   }
   }
 
 
   // Bind tooltips to DOM
   // Bind tooltips to DOM
-  bind_tooltips();
+  set_tooltips();
   Misago.set_tooltips = set_tooltips;
   Misago.set_tooltips = set_tooltips;
   Misago.DOM.on_change(set_tooltips);
   Misago.DOM.on_change(set_tooltips);
   Misago.Server.on_data(bind_tooltips);
   Misago.Server.on_data(bind_tooltips);
+
 });
 });