@@ -397,6 +397,10 @@ Burst = (function(_super) {
397397 return Burst . __super__ . constructor . apply ( this , arguments ) ;
398398 }
399399
400+ Burst . prototype . skipProps = {
401+ childOptions : 1
402+ } ;
403+
400404 Burst . prototype . defaults = {
401405 count : 5 ,
402406 degree : 360 ,
@@ -430,7 +434,7 @@ Burst = (function(_super) {
430434 points : 3 ,
431435 duration : 500 ,
432436 delay : 0 ,
433- repeat : 1 ,
437+ repeat : 0 ,
434438 yoyo : false ,
435439 easing : 'Linear.None' ,
436440 type : 'circle' ,
@@ -456,24 +460,40 @@ Burst = (function(_super) {
456460 } ;
457461
458462 Burst . prototype . run = function ( o ) {
459- var i , tr , _results ;
460- Burst . __super__ . run . apply ( this , arguments ) ;
461- i = this . transits . length ;
462- _results = [ ] ;
463- while ( i -- ) {
464- tr = this . transits [ i ] ;
465- if ( this . props . randomAngle || this . props . randomRadius ) {
463+ var i , key , keys , len , tr , transit , _base , _i , _len , _ref ;
464+ if ( ( o != null ) && Object . keys ( o ) . length ) {
465+ if ( o . count || ( ( _ref = o . childOptions ) != null ? _ref . count : void 0 ) ) {
466+ this . h . warn ( 'Sorry, count can not be changed on run' ) ;
467+ }
468+ this . extendDefaults ( o ) ;
469+ keys = Object . keys ( o . childOptions || { } ) ;
470+ if ( ( _base = this . o ) . childOptions == null ) {
471+ _base . childOptions = { } ;
472+ }
473+ for ( i = _i = 0 , _len = keys . length ; _i < _len ; i = ++ _i ) {
474+ key = keys [ i ] ;
475+ this . o . childOptions [ key ] = o . childOptions [ key ] ;
476+ }
477+ len = this . transits . length ;
478+ while ( len -- ) {
479+ transit = this . transits [ len ] ;
480+ transit . tuneNewOption ( this . getOption ( len ) , true ) ;
481+ }
482+ this . tween . recalcDuration ( ) ;
483+ }
484+ if ( this . props . randomAngle || this . props . randomRadius ) {
485+ len = this . transits . length ;
486+ while ( len -- ) {
487+ tr = this . transits [ len ] ;
466488 this . props . randomAngle && tr . setProp ( {
467489 angleShift : this . generateRandomAngle ( )
468490 } ) ;
469- _results . push ( this . props . randomRadius && tr . setProp ( {
491+ this . props . randomRadius && tr . setProp ( {
470492 radiusScale : this . generateRandomRadius ( )
471- } ) ) ;
472- } else {
473- _results . push ( void 0 ) ;
493+ } ) ;
474494 }
475495 }
476- return _results ;
496+ return this . startTween ( ) ;
477497 } ;
478498
479499 Burst . prototype . createBit = function ( ) {
@@ -1556,23 +1576,25 @@ Tween = require('./tween');
15561576
15571577Transit = require ( './transit' ) ;
15581578
1559- burst = new Transit ( {
1579+ burst = new Burst ( {
15601580 type : 'polygon' ,
15611581 duration : 500 ,
15621582 count : 3 ,
15631583 isIt : true ,
1564- isRunLess : true ,
15651584 radius : {
15661585 0 : 75
15671586 } ,
1568- points : 5
1587+ points : 5 ,
1588+ isSwirl : true ,
1589+ swirlFrequency : 'rand(0,10)' ,
1590+ swirlSize : 'rand(0,10)'
15691591} ) ;
15701592
15711593document . addEventListener ( 'click' , function ( e ) {
15721594 return burst . run ( {
15731595 x : e . x ,
15741596 y : e . y ,
1575- duration : 4000
1597+ duration : 1000
15761598 } ) ;
15771599} ) ;
15781600
@@ -2156,7 +2178,7 @@ Transit = (function(_super) {
21562178 } ;
21572179
21582180 Transit . prototype . extendDefaults = function ( o ) {
2159- var defaultsValue , delta , fromObject , isObject , key , optionsValue , _ref , _results ;
2181+ var defaultsValue , delta , fromObject , isObject , key , optionsValue , _ref , _ref1 , _results ;
21602182 if ( this . props == null ) {
21612183 this . props = { } ;
21622184 }
@@ -2165,6 +2187,9 @@ Transit = (function(_super) {
21652187 _results = [ ] ;
21662188 for ( key in fromObject ) {
21672189 defaultsValue = fromObject [ key ] ;
2190+ if ( ( _ref = this . skipProps ) != null ? _ref [ key ] : void 0 ) {
2191+ continue ;
2192+ }
21682193 if ( o ) {
21692194 this . o [ key ] = defaultsValue ;
21702195 optionsValue = defaultsValue ;
@@ -2186,7 +2211,7 @@ Transit = (function(_super) {
21862211 if ( ( key === 'x' || key === 'y' ) && ! this . o . ctx ) {
21872212 this . h . warn ( 'Consider to animate shiftX/shiftY properties instead of x/y, as it would be much more performant' , optionsValue ) ;
21882213 }
2189- if ( ( _ref = this . skipPropsDelta ) != null ? _ref [ key ] : void 0 ) {
2214+ if ( ( _ref1 = this . skipPropsDelta ) != null ? _ref1 [ key ] : void 0 ) {
21902215 continue ;
21912216 }
21922217 delta = this . h . parseDelta ( key , optionsValue ) ;
@@ -2308,19 +2333,23 @@ Transit = (function(_super) {
23082333 } ;
23092334
23102335 Transit . prototype . run = function ( o ) {
2336+ this . tuneNewOption ( o ) ;
2337+ ! this . o . isDrawLess && this . setProgress ( 0 , true ) ;
2338+ return this . startTween ( ) ;
2339+ } ;
2340+
2341+ Transit . prototype . tuneNewOption = function ( o , isForeign ) {
23112342 if ( ( o != null ) && ( o . type != null ) && o . type !== ( this . o . type || this . type ) ) {
23122343 this . h . warn ( 'Sorry, type can not be changed on run' ) ;
23132344 delete o . type ;
23142345 }
23152346 if ( ( o != null ) && Object . keys ( o ) . length ) {
23162347 this . extendDefaults ( o ) ;
23172348 this . resetTimeline ( ) ;
2318- this . tween . recalcDuration ( ) ;
2349+ ! isForeign && this . tween . recalcDuration ( ) ;
23192350 this . calcSize ( ) ;
2320- this . setElStyles ( ) ;
2351+ return ! isForeign && this . setElStyles ( ) ;
23212352 }
2322- ! this . o . isDrawLess && this . setProgress ( 0 , true ) ;
2323- return this . startTween ( ) ;
23242353 } ;
23252354
23262355 Transit . prototype . startTween = function ( ) {
0 commit comments