@@ -317,8 +317,8 @@ function Vivus (element, options, callback) {
317317
318318/**
319319 * Timing functions
320- **************************************
321- *
320+ **************************************
321+ *
322322 * Default functions to help developers.
323323 * It always take a number as parameter (between 0 to 1) then
324324 * return a number (between 0 and 1)
@@ -383,7 +383,7 @@ Vivus.prototype.setElement = function (element, options) {
383383 case window . HTMLObjectElement :
384384 // If we have to wait for it
385385 var onLoad , self ;
386-
386+
387387 self = this ;
388388 onLoad = function ( e ) {
389389 if ( self . isReady ) {
@@ -565,7 +565,7 @@ Vivus.prototype.mapping = function () {
565565 break ;
566566
567567 case 'scenario-sync' :
568- path = paths [ i ] ;
568+ path = pathObj . el ;
569569 pAttrs = this . parseAttr ( path ) ;
570570 pathObj . startAt = timePoint + ( parsePositiveInt ( pAttrs [ 'data-delay' ] , this . delayUnit ) || 0 ) ;
571571 pathObj . duration = parsePositiveInt ( pAttrs [ 'data-duration' ] , this . duration ) ;
@@ -574,7 +574,7 @@ Vivus.prototype.mapping = function () {
574574 break ;
575575
576576 case 'scenario' :
577- path = paths [ i ] ;
577+ path = pathObj . el ;
578578 pAttrs = this . parseAttr ( path ) ;
579579 pathObj . startAt = parsePositiveInt ( pAttrs [ 'data-start' ] , this . delayUnit ) || 0 ;
580580 pathObj . duration = parsePositiveInt ( pAttrs [ 'data-duration' ] , this . duration ) ;
@@ -661,7 +661,7 @@ Vivus.prototype.trace = function () {
661661 * ressources, too much DOM manupulation..
662662 * but it's the only way to let the magic happen on IE.
663663 * By default, this fallback is only applied on IE.
664- *
664+ *
665665 * @param {Number } index Path index
666666 */
667667Vivus . prototype . renderPath = function ( index ) {
@@ -680,7 +680,7 @@ Vivus.prototype.renderPath = function (index) {
680680 * This this mainly due to the case of passing an
681681 * object tag in the constructor. It will wait
682682 * the end of the loading to initialise.
683- *
683+ *
684684 */
685685Vivus . prototype . init = function ( ) {
686686 // Set object variables
@@ -769,7 +769,7 @@ Vivus.prototype.finish = function () {
769769
770770/**
771771 * Set the level of progress of the drawing.
772- *
772+ *
773773 * @param {number } progress Level of progress to set
774774 */
775775Vivus . prototype . setFrameProgress = function ( progress ) {
@@ -822,6 +822,7 @@ Vivus.prototype.stop = function () {
822822 *
823823 */
824824Vivus . prototype . destroy = function ( ) {
825+ this . stop ( ) ;
825826 var i , path ;
826827 for ( i = 0 ; i < this . map . length ; i ++ ) {
827828 path = this . map [ i ] ;
0 commit comments