examples/map/js/backbone.marionette.js
function(view){

    // shut down the child view properly,
    // including events that the collection has from it
    if (view){
      this.stopListening(view);

      // call 'close' or 'remove', depending on which is found
      if (view.close) { view.close(); }
      else if (view.remove) { view.remove(); }

      this.children.remove(view);
    }

    this.triggerMethod("item:removed", view);
  }
function(view){

    // shut down the child view properly,
    // including events that the collection has from it
    if (view){
      this.stopListening(view);

      // call 'close' or 'remove', depending on which is found
      if (view.close) { view.close(); }
      else if (view.remove) { view.remove(); }

      this.children.remove(view);
    }

    this.triggerMethod("item:removed", view);
  }
function ( view ) { // shut down the child view properly, // including events that the collection has from it if ( view ) { this . stopListening ( view ) ; // call 'close' or 'remove', depending on which is found if ( view . close ) { view . close ( ) ; } else if ( view . remove ) { view . remove ( ) ; } this . children . remove ( view ) ; } this . triggerMethod ( "item:removed" , view ) ; }
Remove the child view and close it
Remove the child view and close it