app/templates/_ignite.js
function waitAndAdvance(step, steps) {
    setTimeout(function(){
      if (step < steps - 1) {
        api.next();
        waitAndAdvance(step+1, steps);
      }
      else {
        // after 15 seconds on last slide, exit fullscreen
        if(document.cancelFullScreen) {
          document.cancelFullScreen();
        } else if(document.mozCancelFullScreen) {
          document.mozCancelFullScreen();
        } else if(document.webkitCancelFullScreen) {
          document.webkitCancelFullScreen();
        }
      }
    }, slideAdvance);
  }
function waitAndAdvance(step, steps) {
    setTimeout(function(){
      if (step < steps - 1) {
        api.next();
        waitAndAdvance(step+1, steps);
      }
      else {
        // after 15 seconds on last slide, exit fullscreen
        if(document.cancelFullScreen) {
          document.cancelFullScreen();
        } else if(document.mozCancelFullScreen) {
          document.mozCancelFullScreen();
        } else if(document.webkitCancelFullScreen) {
          document.webkitCancelFullScreen();
        }
      }
    }, slideAdvance);
  }
function waitAndAdvance ( step , steps ) { setTimeout ( function ( ) { if ( step < steps - 1 ) { api . next ( ) ; waitAndAdvance ( step + 1 , steps ) ; } else { // after 15 seconds on last slide, exit fullscreen if ( document . cancelFullScreen ) { document . cancelFullScreen ( ) ; } else if ( document . mozCancelFullScreen ) { document . mozCancelFullScreen ( ) ; } else if ( document . webkitCancelFullScreen ) { document . webkitCancelFullScreen ( ) ; } } } , slideAdvance ) ; }
recursive function to wait seconds before advancing
recursive function to wait seconds before advancing