function(options) {
      var view = this.currentView;
  
      var emptyOptions = options || {};
      var preventDestroy  = !!emptyOptions.preventDestroy;
      // If there is no view in the region
      // we should not remove anything
      if (!view) { return this; }
  
      view.off('destroy', this.empty, this);
      this.triggerMethod('before:empty', view);
      if (!preventDestroy) {
        this._destroyView();
      }
      this.triggerMethod('empty', view);
  
      // Remove region pointer to the currentView
      delete this.currentView;
  
      if (preventDestroy) {
        this.$el.contents().detach();
      }
  
      return this;
    }
function(options) {
      var view = this.currentView;
  
      var emptyOptions = options || {};
      var preventDestroy  = !!emptyOptions.preventDestroy;
      // If there is no view in the region
      // we should not remove anything
      if (!view) { return this; }
  
      view.off('destroy', this.empty, this);
      this.triggerMethod('before:empty', view);
      if (!preventDestroy) {
        this._destroyView();
      }
      this.triggerMethod('empty', view);
  
      // Remove region pointer to the currentView
      delete this.currentView;
  
      if (preventDestroy) {
        this.$el.contents().detach();
      }
  
      return this;
    }
function ( options ) { var view = this . currentView ; var emptyOptions = options || { } ; var preventDestroy = ! ! emptyOptions . preventDestroy ; // If there is no view in the region // we should not remove anything if ( ! view ) { return this ; } view . off ( 'destroy' , this . empty , this ) ; this . triggerMethod ( 'before:empty' , view ) ; if ( ! preventDestroy ) { this . _destroyView ( ) ; } this . triggerMethod ( 'empty' , view ) ; // Remove region pointer to the currentView delete this . currentView ; if ( preventDestroy ) { this . $el . contents ( ) . detach ( ) ; } return this ; }
Destroy the current view, if there is one. If there is no current view, it does nothing and returns immediately.
Destroy the current view if there is one . If there is no current view it does nothing and returns immediately .