backbone.layoutmanager.js
function(views) {
    // Clear out all existing views.
    _.each(aConcat.call([], views), function(view) {
      // fire cleanup event to the attached handlers
      view.trigger("cleanup", view);

      // Remove all custom events attached to this View.
      view.unbind();

      // Automatically unbind `model`.
      if (view.model instanceof Backbone.Model) {
        view.model.off(null, null, view);
      }

      // Automatically unbind `collection`.
      if (view.collection instanceof Backbone.Collection) {
        view.collection.off(null, null, view);
      }

      // Automatically unbind events bound to this View.
      view.stopListening();

      // If a custom cleanup method was provided on the view, call it after
      // the initial cleanup is done
      if (_.isFunction(view.cleanup)) {
        view.cleanup();
      }
    });
  }
function(views) {
    // Clear out all existing views.
    _.each(aConcat.call([], views), function(view) {
      // fire cleanup event to the attached handlers
      view.trigger("cleanup", view);

      // Remove all custom events attached to this View.
      view.unbind();

      // Automatically unbind `model`.
      if (view.model instanceof Backbone.Model) {
        view.model.off(null, null, view);
      }

      // Automatically unbind `collection`.
      if (view.collection instanceof Backbone.Collection) {
        view.collection.off(null, null, view);
      }

      // Automatically unbind events bound to this View.
      view.stopListening();

      // If a custom cleanup method was provided on the view, call it after
      // the initial cleanup is done
      if (_.isFunction(view.cleanup)) {
        view.cleanup();
      }
    });
  }
function ( views ) { // Clear out all existing views. _ . each ( aConcat . call ( [ ] , views ) , function ( view ) { // fire cleanup event to the attached handlers view . trigger ( "cleanup" , view ) ; // Remove all custom events attached to this View. view . unbind ( ) ; // Automatically unbind `model`. if ( view . model instanceof Backbone . Model ) { view . model . off ( null , null , view ) ; } // Automatically unbind `collection`. if ( view . collection instanceof Backbone . Collection ) { view . collection . off ( null , null , view ) ; } // Automatically unbind events bound to this View. view . stopListening ( ) ; // If a custom cleanup method was provided on the view, call it after // the initial cleanup is done if ( _ . isFunction ( view . cleanup ) ) { view . cleanup ( ) ; } } ) ; }
Accept either a single view or an array of views to clean of all DOM events internal model and collection references and all Backbone.Events.
Accept either a single view or an array of views to clean of all DOM events internal model and collection references and all Backbone . Events .