Skip to content

Commit

Permalink
improper use of $.inArray was causing errors in IE8 and below.
Browse files Browse the repository at this point in the history
  • Loading branch information
heygrady committed Nov 26, 2010
1 parent ee40692 commit 0adab39
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 28 deletions.
10 changes: 5 additions & 5 deletions dist/jquery.transform-0.9.1pre.js
Expand Up @@ -6,7 +6,7 @@
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* Date: Thu Nov 25 02:03:21 2010 -0800
* Date: Fri Nov 26 14:48:28 2010 -0800
*/
///////////////////////////////////////////////////////
// Transform
Expand Down Expand Up @@ -187,7 +187,7 @@
// handle origin separately
if (func == 'origin') {
this[func].apply(this, $.isArray(funcs[func]) ? funcs[func] : [funcs[func]]);
} else if ($.inArray(func, $.transform.funcs) != -1) {
} else if ($.inArray(func, $.transform.funcs) !== -1) {
values.push(this.createTransformFunc(func, funcs[func]));
}
}
Expand Down Expand Up @@ -785,7 +785,7 @@
$.each( prop, function( name, val ) {
if ($.cssMultipleValues[name]
|| $.cssAngle[name]
|| (!$.cssNumber[name] && $.inArray(name, $.transform.funcs))) {
|| (!$.cssNumber[name] && $.inArray(name, $.transform.funcs) !== -1)) {
// force the original values onto the optall
optall.original[name] = val.toString();

Expand Down Expand Up @@ -816,7 +816,7 @@
angle = $.cssAngle[this.prop];

//TODO: simply check for the existence of CSS Hooks?
if (multiple || (!$.cssNumber[this.prop] && $.inArray(this.prop, $.transform.funcs))) {
if (multiple || (!$.cssNumber[this.prop] && $.inArray(this.prop, $.transform.funcs) !== -1)) {
this.values = [];

if (!multiple) {
Expand Down Expand Up @@ -990,7 +990,7 @@
var transform = fx.elem.transform || new $.transform(fx.elem),
funcs = {};

if ($.cssMultipleValues[func] || (!$.cssNumber[func] && $.inArray(func, $.transform.funcs))) {
if ($.cssMultipleValues[func] || (!$.cssNumber[func] && $.inArray(func, $.transform.funcs) !== -1)) {
($.fx.multipleValueStep[fx.prop] || $.fx.multipleValueStep._default)(fx);
funcs[fx.prop] = [];
$.each(fx.values, function(i, val) {
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.transform-0.9.1pre.min.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions dist/jquery.transform.js
Expand Up @@ -6,7 +6,7 @@
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* Date: Thu Nov 25 02:03:21 2010 -0800
* Date: Fri Nov 26 14:48:28 2010 -0800
*/
///////////////////////////////////////////////////////
// Transform
Expand Down Expand Up @@ -187,7 +187,7 @@
// handle origin separately
if (func == 'origin') {
this[func].apply(this, $.isArray(funcs[func]) ? funcs[func] : [funcs[func]]);
} else if ($.inArray(func, $.transform.funcs) != -1) {
} else if ($.inArray(func, $.transform.funcs) !== -1) {
values.push(this.createTransformFunc(func, funcs[func]));
}
}
Expand Down Expand Up @@ -785,7 +785,7 @@
$.each( prop, function( name, val ) {
if ($.cssMultipleValues[name]
|| $.cssAngle[name]
|| (!$.cssNumber[name] && $.inArray(name, $.transform.funcs))) {
|| (!$.cssNumber[name] && $.inArray(name, $.transform.funcs) !== -1)) {
// force the original values onto the optall
optall.original[name] = val.toString();

Expand Down Expand Up @@ -816,7 +816,7 @@
angle = $.cssAngle[this.prop];

//TODO: simply check for the existence of CSS Hooks?
if (multiple || (!$.cssNumber[this.prop] && $.inArray(this.prop, $.transform.funcs))) {
if (multiple || (!$.cssNumber[this.prop] && $.inArray(this.prop, $.transform.funcs) !== -1)) {
this.values = [];

if (!multiple) {
Expand Down Expand Up @@ -990,7 +990,7 @@
var transform = fx.elem.transform || new $.transform(fx.elem),
funcs = {};

if ($.cssMultipleValues[func] || (!$.cssNumber[func] && $.inArray(func, $.transform.funcs))) {
if ($.cssMultipleValues[func] || (!$.cssNumber[func] && $.inArray(func, $.transform.funcs) !== -1)) {
($.fx.multipleValueStep[fx.prop] || $.fx.multipleValueStep._default)(fx);
funcs[fx.prop] = [];
$.each(fx.values, function(i, val) {
Expand Down
6 changes: 3 additions & 3 deletions src/jquery.transform.animate.js
Expand Up @@ -28,7 +28,7 @@
$.each( prop, function( name, val ) {
if ($.cssMultipleValues[name]
|| $.cssAngle[name]
|| (!$.cssNumber[name] && $.inArray(name, $.transform.funcs))) {
|| (!$.cssNumber[name] && $.inArray(name, $.transform.funcs) !== -1)) {
// force the original values onto the optall
optall.original[name] = val.toString();

Expand Down Expand Up @@ -59,7 +59,7 @@
angle = $.cssAngle[this.prop];

//TODO: simply check for the existence of CSS Hooks?
if (multiple || (!$.cssNumber[this.prop] && $.inArray(this.prop, $.transform.funcs))) {
if (multiple || (!$.cssNumber[this.prop] && $.inArray(this.prop, $.transform.funcs) !== -1)) {
this.values = [];

if (!multiple) {
Expand Down Expand Up @@ -233,7 +233,7 @@
var transform = fx.elem.transform || new $.transform(fx.elem),
funcs = {};

if ($.cssMultipleValues[func] || (!$.cssNumber[func] && $.inArray(func, $.transform.funcs))) {
if ($.cssMultipleValues[func] || (!$.cssNumber[func] && $.inArray(func, $.transform.funcs) !== -1)) {
($.fx.multipleValueStep[fx.prop] || $.fx.multipleValueStep._default)(fx);
funcs[fx.prop] = [];
$.each(fx.values, function(i, val) {
Expand Down
2 changes: 1 addition & 1 deletion src/jquery.transform.js
Expand Up @@ -187,7 +187,7 @@
// handle origin separately
if (func == 'origin') {
this[func].apply(this, $.isArray(funcs[func]) ? funcs[func] : [funcs[func]]);
} else if ($.inArray(func, $.transform.funcs) != -1) {
} else if ($.inArray(func, $.transform.funcs) !== -1) {
values.push(this.createTransformFunc(func, funcs[func]));
}
}
Expand Down
22 changes: 10 additions & 12 deletions test/_test.html
Expand Up @@ -47,18 +47,16 @@
var $anim = $('.animate');
var $elem = $('.transform');

var t = 'reflectY';
var o = {};
o[t] = true;
var m = $.matrix[t]();
var d = m.decompose();

console.log('elements', m.elements);
console.log('scaleX:', d.scaleX, 'scaleY', d.scaleY);

$anim.animate($.extend({}, o), 2000);
$elem.first().css($.extend({}, o));
$elem.last().css(d);
$anim.animate({
width: "200px"
}, {duration: 600, complete: function() {$anim.text('Done step 1')}}).animate({
height: "200px"
}, {duration: 600, complete: function() {$anim.text('Done step 2')}}).animate({
width: "120px",
height: "120px"
}, {duration: 600, complete: function() {$anim.text('Done step 3')}}).animate({
marginLeft: "100px"
}, {duration: 600, complete: function() {$anim.text('Done step 4')}});


</script>
Expand Down

0 comments on commit 0adab39

Please sign in to comment.