Closed
Description
Polymer 0.2.2 running in Chrome 33.0.1750.154 m on Windows 7 logs this in the console (and didn't under Polymer 0.2.1):
Uncaught ReferenceError: ParGroup is not defined polymer-animation-group.js:4
(anonymous function) polymer-animation-group.js:4
(anonymous function) polymer-animation-group.js:111
I can reproduce this with a simple test page:
<!doctype html>
<html>
<head>
<title>test page</title>
<script src="bower_components/platform/platform.js"></script>
<link rel="import" href="bower_components/polymer/polymer.html">
<link rel="import" href="bower_components/polymer-animation/polymer-animation.html">
<link rel="import" href="bower_components/polymer-animation/polymer-animation-group.html">
</head>
<body>
</body>
</html>
Problem seems to be ParGroup undefined at the top of polymer-animation-group.js:
(function() {
var ANIMATION_GROUPS = {
'par': ParGroup,
'seq': SeqGroup
};
/**
* @module Animation
*/
/**
* Component for a group of animations.
*
* @class polymer-animation-group
*/
Polymer('polymer-animation-group', {
/**
* If specified the target will be assigned to all child animations.
* @property target
* @type HTMLElement|Node
* @default null
*/
targetSelector: '',
/**
* If specified and not "auto" the duration will apply to the group
* and propagate to any child animations that is not a group and does
* not specify a duration.
* @property duration
* @type number
* @default "auto"
*/
duration: 'auto',
/**
* Group type. 'par' for parallel and 'seq' for sequence.
* @property type
* @type String
* @default 'par'
*/
type: 'par',
typeChanged: function() {
this.apply();
},
targetChanged: function() {
// Only propagate target to children animations if it's defined.
if (this.target) {
this.doOnChildren(function(c) {
c.target = this.target;
}.bind(this));
}
},
durationChanged: function() {
if (this.duration && this.duration !== 'auto') {
this.doOnChildren(function(c) {
// Propagate to children that is not a group and has no
// duration specified.
if (!c.type && (!c.duration || c.duration === 'auto')) {
c.duration = this.duration;
}
}.bind(this));
}
},
doOnChildren: function(inFn) {
var children = this.children;
if (!children.length) {
children = this.webkitShadowRoot ? this.webkitShadowRoot.childNodes : [];
}
Array.prototype.forEach.call(children, function(c) {
// TODO <template> in the way
c.apply && inFn(c);
}, this);
},
makeAnimation: function() {
return new ANIMATION_GROUPS[this.type](this.childAnimations, this.timingProps);
},
hasTarget: function() {
var ht = this.target !== null;
if (!ht) {
this.doOnChildren(function(c) {
ht = ht || c.hasTarget();
}.bind(this));
}
return ht;
},
apply: function() {
// Propagate target and duration to child animations first.
this.durationChanged();
this.targetChanged();
this.doOnChildren(function(c) {
c.apply();
});
return this.super();
},
get childAnimationElements() {
var list = [];
this.doOnChildren(function(c) {
if (c.makeAnimation) {
list.push(c);
}
});
return list;
},
get childAnimations() {
var list = [];
this.doOnChildren(function(c) {
if (c.animation) {
list.push(c.animation);
}
});
return list;
}
});
})();
//# sourceURL=http://127.0.0.1:8080/bower_components/polymer-animation/polymer-animation-group.html/polymer-animation-group.js
Metadata
Assignees
Labels
No labels