backbone.layoutmanager.js
function(view, force) {
    var parentViews;
    // Shorthand the managers for easier access.
    var manager = view.__manager__;
    var rentManager = manager.parent && manager.parent.__manager__;
    // Test for keep.
    var keep = typeof view.keep === "boolean" ? view.keep : view.options.keep;

    // In insert mode, remove views that do not have `keep` attribute set,
    // unless the force flag is set.
    if ((!keep && rentManager && rentManager.insert === true) || force) {
      // Clean out the events.
      LayoutManager.cleanViews(view);

      // Since we are removing this view, force subviews to remove
      view._removeViews(true);

      // Remove the View completely.
      view.$el.remove();

      // Cancel any pending renders, if present.
      view._cancelQueuedRAFRender();

      // Bail out early if no parent exists.
      if (!manager.parent) { return; }

      // Assign (if they exist) the sibling Views to a property.
      parentViews = manager.parent.views[manager.selector];

      // If this is an array of items remove items that are not marked to
      // keep.
      if (_.isArray(parentViews)) {
        // Remove duplicate Views.
        _.each(_.clone(parentViews), function(view, i) {
          // If the managers match, splice off this View.
          if (view && view.__manager__ === manager) {
            aSplice.call(parentViews, i, 1);
          }
        });
        if (_.isEmpty(parentViews)) {
          manager.parent.trigger("empty", manager.selector);
        }
        return;
      }

      // Otherwise delete the parent selector.
      delete manager.parent.views[manager.selector];
      manager.parent.trigger("empty", manager.selector);
    }
  }
function(view, force) {
    var parentViews;
    // Shorthand the managers for easier access.
    var manager = view.__manager__;
    var rentManager = manager.parent && manager.parent.__manager__;
    // Test for keep.
    var keep = typeof view.keep === "boolean" ? view.keep : view.options.keep;

    // In insert mode, remove views that do not have `keep` attribute set,
    // unless the force flag is set.
    if ((!keep && rentManager && rentManager.insert === true) || force) {
      // Clean out the events.
      LayoutManager.cleanViews(view);

      // Since we are removing this view, force subviews to remove
      view._removeViews(true);

      // Remove the View completely.
      view.$el.remove();

      // Cancel any pending renders, if present.
      view._cancelQueuedRAFRender();

      // Bail out early if no parent exists.
      if (!manager.parent) { return; }

      // Assign (if they exist) the sibling Views to a property.
      parentViews = manager.parent.views[manager.selector];

      // If this is an array of items remove items that are not marked to
      // keep.
      if (_.isArray(parentViews)) {
        // Remove duplicate Views.
        _.each(_.clone(parentViews), function(view, i) {
          // If the managers match, splice off this View.
          if (view && view.__manager__ === manager) {
            aSplice.call(parentViews, i, 1);
          }
        });
        if (_.isEmpty(parentViews)) {
          manager.parent.trigger("empty", manager.selector);
        }
        return;
      }

      // Otherwise delete the parent selector.
      delete manager.parent.views[manager.selector];
      manager.parent.trigger("empty", manager.selector);
    }
  }
function ( view , force ) { var parentViews ; // Shorthand the managers for easier access. var manager = view . __manager__ ; var rentManager = manager . parent && manager . parent . __manager__ ; // Test for keep. var keep = typeof view . keep === "boolean" ? view . keep : view . options . keep ; // In insert mode, remove views that do not have `keep` attribute set, // unless the force flag is set. if ( ( ! keep && rentManager && rentManager . insert === true ) || force ) { // Clean out the events. LayoutManager . cleanViews ( view ) ; // Since we are removing this view, force subviews to remove view . _removeViews ( true ) ; // Remove the View completely. view . $el . remove ( ) ; // Cancel any pending renders, if present. view . _cancelQueuedRAFRender ( ) ; // Bail out early if no parent exists. if ( ! manager . parent ) { return ; } // Assign (if they exist) the sibling Views to a property. parentViews = manager . parent . views [ manager . selector ] ; // If this is an array of items remove items that are not marked to // keep. if ( _ . isArray ( parentViews ) ) { // Remove duplicate Views. _ . each ( _ . clone ( parentViews ) , function ( view , i ) { // If the managers match, splice off this View. if ( view && view . __manager__ === manager ) { aSplice . call ( parentViews , i , 1 ) ; } } ) ; if ( _ . isEmpty ( parentViews ) ) { manager . parent . trigger ( "empty" , manager . selector ) ; } return ; } // Otherwise delete the parent selector. delete manager . parent . views [ manager . selector ] ; manager . parent . trigger ( "empty" , manager . selector ) ; } }
Remove a single nested View.
Remove a single nested View .