Bug Tracker

Changeset 5810

Show
Ignore:
Timestamp:
08/07/08 17:11:53 (4 months ago)
Author:
kswedberg
Message:

clueTip: little jsLint cleanup; added an option for dropShadowColor (thx, David Enete)

Files:
1 modified

Legend:

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

    r5771 r5810  
    8989        $cluetipArrows = $('<div id="cluetip-arrows" class="cluetip-arrows"></div>').css({zIndex: cluezIndex+1}).appendTo('#cluetip'); 
    9090      } 
    91       var dropShadowSteps = (opts.dropShadow) ? +opts.dropShadowSteps : 0; 
     91      var dropShadowSteps = opts.dropShadow ? +opts.dropShadowSteps : 0; 
    9292      if (!$dropShadow) { 
    9393        $dropShadow = $([]); 
    9494        for (var i=0; i < dropShadowSteps; i++) { 
    9595          $dropShadow = $dropShadow.add($('<div></div>').css({zIndex: cluezIndex-i-1, opacity:.1, top: 1+i, left: 1+i})); 
    96         }; 
    97         $dropShadow.css({position: 'absolute', backgroundColor: '#000'}) 
     96        } 
     97        $dropShadow.css({position: 'absolute', backgroundColor: opts.dropShadowColor}) 
    9898        .prependTo($cluetip); 
    9999      } 
    100100      var tipAttribute = $this.attr(opts.attribute), ctClass = opts.cluetipClass; 
    101       if (!tipAttribute && !opts.splitTitle && !js) return true; 
     101      if (!tipAttribute && !opts.splitTitle && !js) {return true;} 
    102102      // if hideLocal is set to true, on DOM ready hide the local content that will be displayed in the clueTip 
    103103      if (opts.local && opts.localPrefix) {tipAttribute = opts.localPrefix + tipAttribute;} 
     
    110110      // horizontal measurement variables 
    111111      var tipInnerWidth = isNaN(parseInt(opts.width, 10)) ? 275 : parseInt(opts.width, 10); 
    112       var tipWidth = tipInnerWidth + (parseInt($cluetip.css('paddingLeft'))||0) + (parseInt($cluetip.css('paddingRight'))||0) + dropShadowSteps; 
     112      var tipWidth = tipInnerWidth + (parseInt($cluetip.css('paddingLeft'),10)||0) + (parseInt($cluetip.css('paddingRight'),10)||0) + dropShadowSteps; 
    113113      var linkWidth = this.offsetWidth; 
    114114      var linkLeft, posX, tipX, mouseX, winWidth; 
     
    188188        var tpl = tipParts.length; 
    189189        for (var i=0; i < tpl; i++){ 
    190           if (i == 0) { 
     190          if (i === 0) { 
    191191            $cluetipInner.html(tipParts[i]); 
    192192          } else {  
    193193            $cluetipInner.append('<div class="split-body">' + tipParts[i] + '</div>'); 
    194194          }             
    195         }; 
     195        } 
    196196        cluetipShow(pY); 
    197197      } 
     
    200200***************************************/ 
    201201 
    202       else if (!opts.local && tipAttribute.indexOf('#') != 0) { 
     202      else if (!opts.local && tipAttribute.indexOf('#') !== 0) { 
    203203        if (cluetipContents && opts.ajaxCache) { 
    204204          $cluetipInner.html(cluetipContents); 
     
    239239                } else { 
    240240                    $('#cluetip-waitimage').hide(); 
    241                   if (isActive) cluetipShow(pY);     
     241                  if (isActive) {cluetipShow(pY);}     
    242242                }  
    243243          }; 
     
    466466    arrows:           false,    // if true, displays arrow on appropriate side of clueTip 
    467467    dropShadow:       true,     // set to false if you don't want the drop-shadow effect on the clueTip 
     468    dropShadowColor:  '#000', 
    468469    dropShadowSteps:  6,        // adjusts the size of the drop shadow 
    469470    sticky:           false,    // keep visible until manually closed