import v1.1.0_beta1 | 2009-08-21
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
/*
|
||||
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
|
||||
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 2.6.0
|
||||
version: 2.7.0
|
||||
*/
|
||||
(function() {
|
||||
|
||||
@ -89,11 +89,16 @@ Anim.prototype = {
|
||||
* @param {String} unit The unit ('px', '%', etc.) of the value.
|
||||
*/
|
||||
setAttribute: function(attr, val, unit) {
|
||||
var el = this.getEl();
|
||||
if ( this.patterns.noNegatives.test(attr) ) {
|
||||
val = (val > 0) ? val : 0;
|
||||
}
|
||||
|
||||
Y.Dom.setStyle(this.getEl(), attr, val + unit);
|
||||
if ('style' in el) {
|
||||
Y.Dom.setStyle(el, attr, val + unit);
|
||||
} else if (attr in el) {
|
||||
el[attr] = val;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@ -114,11 +119,15 @@ Anim.prototype = {
|
||||
var pos = !!( a[3] ); // top or left
|
||||
var box = !!( a[2] ); // width or height
|
||||
|
||||
// use offsets for width/height and abs pos top/left
|
||||
if ( box || (Y.Dom.getStyle(el, 'position') == 'absolute' && pos) ) {
|
||||
val = el['offset' + a[0].charAt(0).toUpperCase() + a[0].substr(1)];
|
||||
} else { // default to zero for other 'auto'
|
||||
val = 0;
|
||||
if ('style' in el) {
|
||||
// use offsets for width/height and abs pos top/left
|
||||
if ( box || (Y.Dom.getStyle(el, 'position') == 'absolute' && pos) ) {
|
||||
val = el['offset' + a[0].charAt(0).toUpperCase() + a[0].substr(1)];
|
||||
} else { // default to zero for other 'auto'
|
||||
val = 0;
|
||||
}
|
||||
} else if (attr in el) {
|
||||
val = el[attr];
|
||||
}
|
||||
|
||||
return val;
|
||||
@ -1382,4 +1391,4 @@ YAHOO.util.Easing = {
|
||||
|
||||
Y.Scroll = Scroll;
|
||||
})();
|
||||
YAHOO.register("animation", YAHOO.util.Anim, {version: "2.6.0", build: "1321"});
|
||||
YAHOO.register("animation", YAHOO.util.Anim, {version: "2.7.0", build: "1799"});
|
||||
|
12
webdir/javascript/yui/animation/animation-min.js
vendored
12
webdir/javascript/yui/animation/animation-min.js
vendored
File diff suppressed because one or more lines are too long
27
webdir/javascript/yui/animation/animation.js
vendored
27
webdir/javascript/yui/animation/animation.js
vendored
@ -1,8 +1,8 @@
|
||||
/*
|
||||
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
|
||||
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 2.6.0
|
||||
version: 2.7.0
|
||||
*/
|
||||
(function() {
|
||||
|
||||
@ -88,11 +88,16 @@ Anim.prototype = {
|
||||
* @param {String} unit The unit ('px', '%', etc.) of the value.
|
||||
*/
|
||||
setAttribute: function(attr, val, unit) {
|
||||
var el = this.getEl();
|
||||
if ( this.patterns.noNegatives.test(attr) ) {
|
||||
val = (val > 0) ? val : 0;
|
||||
}
|
||||
|
||||
Y.Dom.setStyle(this.getEl(), attr, val + unit);
|
||||
if ('style' in el) {
|
||||
Y.Dom.setStyle(el, attr, val + unit);
|
||||
} else if (attr in el) {
|
||||
el[attr] = val;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@ -113,11 +118,15 @@ Anim.prototype = {
|
||||
var pos = !!( a[3] ); // top or left
|
||||
var box = !!( a[2] ); // width or height
|
||||
|
||||
// use offsets for width/height and abs pos top/left
|
||||
if ( box || (Y.Dom.getStyle(el, 'position') == 'absolute' && pos) ) {
|
||||
val = el['offset' + a[0].charAt(0).toUpperCase() + a[0].substr(1)];
|
||||
} else { // default to zero for other 'auto'
|
||||
val = 0;
|
||||
if ('style' in el) {
|
||||
// use offsets for width/height and abs pos top/left
|
||||
if ( box || (Y.Dom.getStyle(el, 'position') == 'absolute' && pos) ) {
|
||||
val = el['offset' + a[0].charAt(0).toUpperCase() + a[0].substr(1)];
|
||||
} else { // default to zero for other 'auto'
|
||||
val = 0;
|
||||
}
|
||||
} else if (attr in el) {
|
||||
val = el[attr];
|
||||
}
|
||||
|
||||
return val;
|
||||
@ -1378,4 +1387,4 @@ YAHOO.util.Easing = {
|
||||
|
||||
Y.Scroll = Scroll;
|
||||
})();
|
||||
YAHOO.register("animation", YAHOO.util.Anim, {version: "2.6.0", build: "1321"});
|
||||
YAHOO.register("animation", YAHOO.util.Anim, {version: "2.7.0", build: "1799"});
|
||||
|
Reference in New Issue
Block a user