Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/12/2012, 07:46
thehack
 
Fecha de Ingreso: abril-2010
Mensajes: 151
Antigüedad: 14 años
Puntos: 1
problemas con popover booptratp

hola amigo buenas comoe stan e tratado de cargar un contenido html a travez de ajax en el popover bootstrap de twiter pero no me carga al hacer un click si no que debo hacer dos clip para q me cargue aca el codigo para que me ayude gracias


Código Javascript:
Ver original
  1. var notifica = {
  2.  
  3.     cache: {},
  4.     retry: Array(),
  5.  
  6.     ajax: function (param, cb, obj, nowait, process_response) {
  7.         if (obj && obj.hasClass('loading-icon')) return;
  8.         notifica.retry.push(param);
  9.         notifica.retry.push(cb);
  10.         var error = param[0]!='action=count';
  11.         if (obj) {
  12.             obj.addClass('loading-icon');
  13.         }
  14.         if(nowait !== undefined && nowait){
  15.             if (obj) {
  16.                 obj.removeClass('loading-icon');
  17.             }
  18.             cb(obj);
  19.         }else{
  20.             nowait = false;
  21.         }
  22.  
  23.         if(process_response !== undefined && process_response){
  24.             $.ajax({
  25.                 url: global_data.url + 'follows/follow',
  26.                 dataType: 'json',
  27.                 type: 'post',
  28.                 data: param.join('&')+gget('key'),
  29.                 success: function (r) {
  30.                    
  31.                     switch(r.status){
  32.                         case 0:
  33.                             mydialog.alert(r.data, 'opps!')
  34.                         break;
  35.                         default:
  36.                             break;
  37.                     }
  38.                 }
  39.             });
  40.         }else{
  41.             $.ajax({
  42.                 url: global_data.url + 'notificaciones', type: 'post', dataType: 'html', data: param.join('&')+ gget('key'),
  43.                 success: function (r) {
  44.                     if(!nowait){
  45.                         if (obj) {
  46.                            
  47.                             cb(obj, r);
  48.                         } else {
  49.                             cb(r);
  50.                         }
  51.                     }
  52.                 }
  53.             });
  54.         }
  55.     },
  56.     last: function () {
  57.         if($('#compose-box').hasClass('noHideForce'))
  58.             return false;
  59.            
  60.         var c = parseInt($('#notifications-navitem > a > span.badge').html()),
  61.             notifications_box = $('#notifications_box'),
  62.             notifications_navitem = $('#notifications-navitem');
  63.        
  64.         if ($(notifications_box).css('display') != 'none') {
  65.             $(notifications_box).hide();
  66.             $(notifications_navitem).removeClass('active');
  67.                         $('#mensajes-navitem').removeClass('active');
  68.                        
  69.         }
  70.         else {
  71.             if (($(notifications_box).css('display') == 'none' && c > 0) || typeof notifica.cache.last == 'undefined') {
  72.                
  73.                                 //$(notifications_navitem).children('i').addClass('loading-icon');
  74.                 $(notifications_navitem).addClass('active');
  75.                                 $('#mensajes-navitem').removeClass('active');
  76.                                
  77.                 notifica.ajax(
  78.                     Array('action=last'),
  79.                     function (obj, r) {
  80.                         notifica.cache['last'] = r;
  81.                         notifica.show();
  82.                                                
  83.                     },
  84.                     $(notifications_navitem)
  85.                                        
  86.                 );
  87.             } else {
  88.                 notifica.show();
  89.                                
  90.             }
  91.         }
  92.     },
  93.  
  94.     show: function () {
  95.         if (typeof notifica.cache.last != 'undefined') {
  96.                      
  97.             //$('#notifications_box').popover().show().children().children('div.list').html(notifica.cache.last);
  98.                         $('#notifications-navitem').popover({html: true});
  99.                        
  100.             $('#notifications-navitem').attr("data-content", notifica.cache.last);
  101.                        
  102.                         $('#notificar').slimScroll({
  103.                   width: '350px',
  104.                   alwaysVisible: true
  105.               });
  106.  
  107.             //menuPopupAlert('notifications-navitem', 0);
  108.             //ajaxCheck.add('notifications', 0);
  109.         }
  110.     }
  111. }

coloco el javascript completo para que me digan el porque no me cargar al hacer un click