1 Polymer.mixin2 = function(prototype, mixin) {
3 // adds a single mixin to prototype
5 if (mixin.mixinPublish) {
6 prototype.publish = prototype.publish || {};
7 Polymer.mixin(prototype.publish, mixin.mixinPublish);
10 if (mixin.mixinDelegates) {
11 prototype.eventDelegates = prototype.eventDelegates || {};
12 for (var e in mixin.mixinDelegates) {
13 if (!prototype.eventDelegates[e]) {
14 prototype.eventDelegates[e] = mixin.mixinDelegates[e];
19 if (mixin.mixinObserve) {
20 prototype.observe = prototype.observe || {};
21 for (var o in mixin.mixinObserve) {
22 if (!prototype.observe[o] && !prototype[o + 'Changed']) {
23 prototype.observe[o] = mixin.mixinObserve[o];
28 Polymer.mixin(prototype, mixin);
30 delete prototype.mixinPublish;
31 delete prototype.mixinDelegates;
32 delete prototype.mixinObserve;