@@ -19,12 +19,14 @@ $.effects = {
19
19
} ;
20
20
21
21
/*!
22
- * jQuery Color Animations
22
+ * jQuery Color Animations v2.0.0
23
23
* http://jquery.com/
24
24
*
25
25
* Copyright 2012 jQuery Foundation and other contributors
26
- * Dual licensed under the MIT or GPL Version 2 licenses .
26
+ * Released under the MIT license .
27
27
* http://jquery.org/license
28
+ *
29
+ * Date: Mon Aug 13 13:41:02 2012 -0500
28
30
*/
29
31
( function ( jQuery , undefined ) {
30
32
@@ -272,8 +274,8 @@ color.fn = jQuery.extend( color.prototype, {
272
274
} ) ;
273
275
} else {
274
276
each ( spaces , function ( spaceName , space ) {
277
+ var cache = space . cache ;
275
278
each ( space . props , function ( key , prop ) {
276
- var cache = space . cache ;
277
279
278
280
// if the cache doesn't exist, and we know how to convert
279
281
if ( ! inst [ cache ] && space . to ) {
@@ -290,6 +292,15 @@ color.fn = jQuery.extend( color.prototype, {
290
292
// call clamp with alwaysAllowEmpty
291
293
inst [ cache ] [ prop . idx ] = clamp ( red [ key ] , prop , true ) ;
292
294
} ) ;
295
+
296
+ // everything defined but alpha?
297
+ if ( inst [ cache ] && $ . inArray ( null , inst [ cache ] . slice ( 0 , 3 ) ) < 0 ) {
298
+ // use the default of 1
299
+ inst [ cache ] [ 3 ] = 1 ;
300
+ if ( space . from ) {
301
+ inst . _rgba = space . from ( inst [ cache ] ) ;
302
+ }
303
+ }
293
304
} ) ;
294
305
}
295
306
return this ;
@@ -581,19 +592,23 @@ each( spaces, function( spaceName, space ) {
581
592
each ( stepHooks , function ( i , hook ) {
582
593
jQuery . cssHooks [ hook ] = {
583
594
set : function ( elem , value ) {
584
- var parsed , backgroundColor , curElem ;
595
+ var parsed , curElem ,
596
+ backgroundColor = "" ;
585
597
586
598
if ( jQuery . type ( value ) !== "string" || ( parsed = stringParse ( value ) ) ) {
587
599
value = color ( parsed || value ) ;
588
600
if ( ! support . rgba && value . _rgba [ 3 ] !== 1 ) {
589
601
curElem = hook === "backgroundColor" ? elem . parentNode : elem ;
590
- do {
591
- backgroundColor = jQuery . css ( curElem , "backgroundColor" ) ;
592
- } while (
593
- ( backgroundColor === "" || backgroundColor === "transparent" ) &&
594
- ( curElem = curElem . parentNode ) &&
595
- curElem . style
596
- ) ;
602
+ while (
603
+ ( backgroundColor === "" || backgroundColor === "transparent" ) &&
604
+ curElem && curElem . style
605
+ ) {
606
+ try {
607
+ backgroundColor = jQuery . css ( curElem , "backgroundColor" ) ;
608
+ curElem = curElem . parentNode ;
609
+ } catch ( e ) {
610
+ }
611
+ }
597
612
598
613
value = value . blend ( backgroundColor && backgroundColor !== "transparent" ?
599
614
backgroundColor :
@@ -619,6 +634,17 @@ each( stepHooks, function( i, hook ) {
619
634
} ;
620
635
} ) ;
621
636
637
+ jQuery . cssHooks . borderColor = {
638
+ expand : function ( value ) {
639
+ var expanded = { } ;
640
+
641
+ each ( [ "Top" , "Right" , "Bottom" , "Left" ] , function ( i , part ) {
642
+ expanded [ "border" + part + "Color" ] = value ;
643
+ } ) ;
644
+ return expanded ;
645
+ }
646
+ } ;
647
+
622
648
// Basic color names only.
623
649
// Usage of any of the other color names requires adding yourself or including
624
650
// jquery.color.svg-names.js.
@@ -641,7 +667,7 @@ colors = jQuery.Color.names = {
641
667
white : "#ffffff" ,
642
668
yellow : "#ffff00" ,
643
669
644
- // 4.2.3. ‘ transparent’ color keyword
670
+ // 4.2.3. " transparent" color keyword
645
671
transparent : [ null , null , null , 0 ] ,
646
672
647
673
_default : "#ffffff"
0 commit comments