Bug Tracker

Changeset 5842

Show
Ignore:
Timestamp:
09/09/08 17:06:37 (4 months ago)
Author:
kswedberg
Message:

clueTip plugin: fixed ellipses bug with truncate (http://plugins.jquery.com/node/3770)
fixed inserting multiple divs when loading local content (http://plugins.jquery.com/node/3925)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/plugins/cluetip/jquery.cluetip.js

    r5810 r5842  
    122122        tipTitle = tipParts.shift(); 
    123123      } 
    124       var localContent; 
     124      var localContent, wrapped = false; 
    125125 
    126126/***************************************       
     
    250250      } else if (opts.local){ 
    251251        var $localContent = $(tipAttribute + ':first'); 
    252         var localCluetip = $.fn.wrapInner ? $localContent.wrapInner('<div></div>').children().clone(true) : $localContent.html(); 
    253         $.fn.wrapInner ? $cluetipInner.empty().append(localCluetip) : $cluetipInner.html(localCluetip); 
     252        if (typeof $.fn.wrapInner  != 'undefined') { 
     253          if (wrapped === false) { 
     254            $localContent.wrapInner('<div></div>'); 
     255          } 
     256          wrapped = true; 
     257          var $localCluetip = $localContent.children().clone(true); 
     258          $cluetipInner.empty().append($localCluetip); 
     259        } else { 
     260          $cluetipInner.html($localContent.html()); 
     261        } 
    254262        cluetipShow(pY); 
    255263      } 
     
    260268      $cluetip.addClass('cluetip-' + ctClass); 
    261269       
    262       if (opts.truncate) {  
     270      if (opts.truncate && (+opts.truncate < $cluetipInner.text().length)) {  
    263271        var $truncloaded = $cluetipInner.text().slice(0,opts.truncate) + '...'; 
    264272        $cluetipInner.html($truncloaded); 
     
    332340      } 
    333341      opts.onShow($cluetip, $cluetipInner); 
    334        
    335342    }; 
    336343