torso-bundle.js
function(injectionSiteName, previousView, newView, options) {
      var newInjectionSite, currentPromise,
        previousDeferred = $.Deferred();
      this.attachView(injectionSiteName, previousView, options);
      options.cachedInjectionSite = previousView.injectionSite;
      newInjectionSite = options.newInjectionSite = $('<span inject="' + injectionSiteName + '">');
      if (options.addBefore) {
        previousView.$el.before(newInjectionSite);
      } else {
        previousView.$el.after(newInjectionSite);
      }

      // clear the injections site so it isn't replaced back into the dom.
      previousView.injectionSite = undefined;

      // transition previous view out
      previousView.transitionOut(previousDeferred.resolve, options);
      // transition new current view in
      currentPromise = this.__transitionInView(newInjectionSite, newView, options);

      // return a combined promise
      return $.when(previousDeferred.promise(), currentPromise);
    }
function(injectionSiteName, previousView, newView, options) {
      var newInjectionSite, currentPromise,
        previousDeferred = $.Deferred();
      this.attachView(injectionSiteName, previousView, options);
      options.cachedInjectionSite = previousView.injectionSite;
      newInjectionSite = options.newInjectionSite = $('<span inject="' + injectionSiteName + '">');
      if (options.addBefore) {
        previousView.$el.before(newInjectionSite);
      } else {
        previousView.$el.after(newInjectionSite);
      }

      // clear the injections site so it isn't replaced back into the dom.
      previousView.injectionSite = undefined;

      // transition previous view out
      previousView.transitionOut(previousDeferred.resolve, options);
      // transition new current view in
      currentPromise = this.__transitionInView(newInjectionSite, newView, options);

      // return a combined promise
      return $.when(previousDeferred.promise(), currentPromise);
    }
function ( injectionSiteName , previousView , newView , options ) { var newInjectionSite , currentPromise , previousDeferred = $ . Deferred ( ) ; this . attachView ( injectionSiteName , previousView , options ) ; options . cachedInjectionSite = previousView . injectionSite ; newInjectionSite = options . newInjectionSite = $ ( '<span inject="' + injectionSiteName + '">' ) ; if ( options . addBefore ) { previousView . $el . before ( newInjectionSite ) ; } else { previousView . $el . after ( newInjectionSite ) ; } // clear the injections site so it isn't replaced back into the dom. previousView . injectionSite = undefined ; // transition previous view out previousView . transitionOut ( previousDeferred . resolve , options ) ; // transition new current view in currentPromise = this . __transitionInView ( newInjectionSite , newView , options ) ; // return a combined promise return $ . when ( previousDeferred . promise ( ) , currentPromise ) ; }
Will transition out previousView at the same time as transitioning in newView.
@method __performTwoWayTransition
@param injectionSiteName {String} The name of the injection site in the template. This is the value corresponding to the attribute "inject".
@param previousView {View} the view that should be transitioned out.
@param newView {View} The view that should be transitioned into the injection site
@param [options] {Object} optional options object. This options object will be passed on to the transitionIn and transitionOut methods as well.
@param   [options.addBefore=false] {Boolean} if true, the new view's element will be added before the previous view's element. Defaults to after.
@return {Promise} resolved when all transitions are complete. No payload is provided upon resolution.
@private
Will transition out previousView at the same time as transitioning in newView .