demo/amd/rjs/output/unified/marionette-build.js
function() {
      if (this.isDestroyed) { return this; }
  
      var args = _.toArray(arguments);
  
      this.triggerMethod.apply(this, ['before:destroy'].concat(args));
  
      // mark as destroyed before doing the actual destroy, to
      // prevent infinite loops within "destroy" event handlers
      // that are trying to destroy other views
      this.isDestroyed = true;
      this.triggerMethod.apply(this, ['destroy'].concat(args));
  
      // unbind UI elements
      this.unbindUIElements();
  
      this.isRendered = false;
  
      // remove the view from the DOM
      this.remove();
  
      // Call destroy on each behavior after
      // destroying the view.
      // This unbinds event listeners
      // that behaviors have registered for.
      _.invoke(this._behaviors, 'destroy', args);
  
      return this;
    }
function() {
      if (this.isDestroyed) { return this; }
  
      var args = _.toArray(arguments);
  
      this.triggerMethod.apply(this, ['before:destroy'].concat(args));
  
      // mark as destroyed before doing the actual destroy, to
      // prevent infinite loops within "destroy" event handlers
      // that are trying to destroy other views
      this.isDestroyed = true;
      this.triggerMethod.apply(this, ['destroy'].concat(args));
  
      // unbind UI elements
      this.unbindUIElements();
  
      this.isRendered = false;
  
      // remove the view from the DOM
      this.remove();
  
      // Call destroy on each behavior after
      // destroying the view.
      // This unbinds event listeners
      // that behaviors have registered for.
      _.invoke(this._behaviors, 'destroy', args);
  
      return this;
    }
function ( ) { if ( this . isDestroyed ) { return this ; } var args = _ . toArray ( arguments ) ; this . triggerMethod . apply ( this , [ 'before:destroy' ] . concat ( args ) ) ; // mark as destroyed before doing the actual destroy, to // prevent infinite loops within "destroy" event handlers // that are trying to destroy other views this . isDestroyed = true ; this . triggerMethod . apply ( this , [ 'destroy' ] . concat ( args ) ) ; // unbind UI elements this . unbindUIElements ( ) ; this . isRendered = false ; // remove the view from the DOM this . remove ( ) ; // Call destroy on each behavior after // destroying the view. // This unbinds event listeners // that behaviors have registered for. _ . invoke ( this . _behaviors , 'destroy' , args ) ; return this ; }
Default `destroy` implementation, for removing a view from the DOM and unbinding it. Regions will call this method for you. You can specify an `onDestroy` method in your view to add custom code that is called after the view is destroyed.
Default destroy implementation for removing a view from the DOM and unbinding it . Regions will call this method for you . You can specify an onDestroy method in your view to add custom code that is called after the view is destroyed .