backbone.layoutmanager.js
function(fn) {
    var views;

    // If the filter argument is a String, then return a chained Version of the
    // elements. The value at the specified filter may be undefined, a single
    // view, or an array of views; in all cases, chain on a flat array.
    if (typeof fn === "string") {
      fn = this.sections[fn] || fn;
      views = this.views[fn] || [];

      // If Views is undefined you are concatenating an `undefined` to an array
      // resulting in a value being returned.  Defaulting to an array prevents
      // this.
      //return _.chain([].concat(views || []));
      return _.chain([].concat(views));
    }

    // Generate an array of all top level (no deeply nested) Views flattened.
    views = _.chain(this.views).map(function(view) {
      return _.isArray(view) ? view : [view];
    }, this).flatten();

    // If the argument passed is an Object, then pass it to `_.where`.
    if (typeof fn === "object") {
      return views.where(fn);
    }

    // If a filter function is provided, run it on all Views and return a
    // wrapped chain. Otherwise, simply return a wrapped chain of all Views.
    return typeof fn === "function" ? views.filter(fn) : views;
  }
function(fn) {
    var views;

    // If the filter argument is a String, then return a chained Version of the
    // elements. The value at the specified filter may be undefined, a single
    // view, or an array of views; in all cases, chain on a flat array.
    if (typeof fn === "string") {
      fn = this.sections[fn] || fn;
      views = this.views[fn] || [];

      // If Views is undefined you are concatenating an `undefined` to an array
      // resulting in a value being returned.  Defaulting to an array prevents
      // this.
      //return _.chain([].concat(views || []));
      return _.chain([].concat(views));
    }

    // Generate an array of all top level (no deeply nested) Views flattened.
    views = _.chain(this.views).map(function(view) {
      return _.isArray(view) ? view : [view];
    }, this).flatten();

    // If the argument passed is an Object, then pass it to `_.where`.
    if (typeof fn === "object") {
      return views.where(fn);
    }

    // If a filter function is provided, run it on all Views and return a
    // wrapped chain. Otherwise, simply return a wrapped chain of all Views.
    return typeof fn === "function" ? views.filter(fn) : views;
  }
function ( fn ) { var views ; // If the filter argument is a String, then return a chained Version of the // elements. The value at the specified filter may be undefined, a single // view, or an array of views; in all cases, chain on a flat array. if ( typeof fn === "string" ) { fn = this . sections [ fn ] || fn ; views = this . views [ fn ] || [ ] ; // If Views is undefined you are concatenating an `undefined` to an array // resulting in a value being returned.  Defaulting to an array prevents // this. //return _.chain([].concat(views || [])); return _ . chain ( [ ] . concat ( views ) ) ; } // Generate an array of all top level (no deeply nested) Views flattened. views = _ . chain ( this . views ) . map ( function ( view ) { return _ . isArray ( view ) ? view : [ view ] ; } , this ) . flatten ( ) ; // If the argument passed is an Object, then pass it to `_.where`. if ( typeof fn === "object" ) { return views . where ( fn ) ; } // If a filter function is provided, run it on all Views and return a // wrapped chain. Otherwise, simply return a wrapped chain of all Views. return typeof fn === "function" ? views . filter ( fn ) : views ; }
Provide a filter function to get a flattened array of all the subviews. If the filter function is omitted it will return all subviews.  If a String is passed instead, it will return the Views for that selector.
Provide a filter function to get a flattened array of all the subviews . If the filter function is omitted it will return all subviews . If a String is passed instead it will return the Views for that selector .