Skip to content

Commit 730446e

Browse files
committed
Effects: Update jquery-color.
1 parent 7ce3069 commit 730446e

File tree

2 files changed

+11
-16
lines changed

2 files changed

+11
-16
lines changed

ui/.jshintrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"boss": true,
32
"browser": true,
43
"curly": true,
54
"eqnull": true,

ui/jquery.ui.effect.js

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $.effects = {
2121
* jQuery Color Animations
2222
* http://jquery.org/
2323
*
24-
* Copyright 2011 John Resig
24+
* Copyright 2012 John Resig
2525
* Dual licensed under the MIT or GPL Version 2 licenses.
2626
* http://jquery.org/license
2727
*/
@@ -149,7 +149,6 @@ var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightCo
149149
floor: true
150150
}
151151
},
152-
rgbaspace = spaces.rgba.props,
153152
support = color.support = {},
154153

155154
// colors = jQuery.Color.names
@@ -158,11 +157,11 @@ var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightCo
158157
// local aliases of functions called often
159158
each = jQuery.each;
160159

161-
spaces.hsla.props.alpha = rgbaspace.alpha;
160+
spaces.hsla.props.alpha = spaces.rgba.props.alpha;
162161

163162
function clamp( value, prop, alwaysAllowEmpty ) {
164163
var type = propTypes[ prop.type ] || {},
165-
allowEmpty = prop.empty || alwaysAllowEmpty;
164+
allowEmpty = alwaysAllowEmpty || prop.empty;
166165

167166
if ( allowEmpty && value == null ) {
168167
return null;
@@ -179,7 +178,7 @@ function clamp( value, prop, alwaysAllowEmpty ) {
179178
return prop.def;
180179
}
181180
if ( type.mod ) {
182-
value = value % type.mod;
181+
value %= type.mod;
183182
// -10 -> 350
184183
return value < 0 ? type.mod + value : value;
185184
}
@@ -226,21 +225,18 @@ function stringParse( string ) {
226225
return inst;
227226
}
228227

229-
// named colors / default - filter back through parse function
230-
if ( string = colors[ string ] ) {
231-
return string;
232-
}
228+
// named colors
229+
return colors[ string ];
233230
}
234231

235-
color.fn = color.prototype = {
236-
constructor: color,
232+
color.fn = jQuery.extend( color.prototype, {
237233
parse: function( red, green, blue, alpha ) {
238234
if ( red === undefined ) {
239235
this._rgba = [ null, null, null, null ];
240236
return this;
241237
}
242-
if ( red instanceof jQuery || red.nodeType ) {
243-
red = red instanceof jQuery ? red.css( green ) : jQuery( red ).css( green );
238+
if ( red.jquery || red.nodeType ) {
239+
red = jQuery( red ).css( green );
244240
green = undefined;
245241
}
246242

@@ -260,7 +256,7 @@ color.fn = color.prototype = {
260256
}
261257

262258
if ( type === "array" ) {
263-
each( rgbaspace, function( key, prop ) {
259+
each( spaces.rgba.props, function( key, prop ) {
264260
rgba[ prop.idx ] = clamp( red[ prop.idx ], prop );
265261
});
266262
return this;
@@ -428,7 +424,7 @@ color.fn = color.prototype = {
428424
toString: function() {
429425
return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString();
430426
}
431-
};
427+
});
432428
color.fn.parse.prototype = color.fn;
433429

434430
// hsla conversions adapted from:

0 commit comments

Comments
 (0)