• Jump To … +
    modules/Behavior.js modules/Cell.js modules/Collection.js modules/Events.js modules/FormModel.js modules/FormView.js modules/ListView.js modules/Model.js modules/NestedCell.js modules/NestedModel.js modules/Router.js modules/ServiceCell.js modules/View.js modules/behaviors/DataBehavior.js modules/configure.js modules/handlebarsUtils.js modules/history.js modules/mixins/cacheMixin.js modules/mixins/cellMixin.js modules/mixins/loadingMixin.js modules/mixins/modelMixin.js modules/mixins/pollingMixin.js modules/registry.js modules/stickitUtils.js modules/templateRenderer.js modules/torso.js modules/validation.js
  • NestedCell.js

  • ¶
    (function(root, factory) {
      if (typeof define === 'function' && define.amd) {
        define(['underscore', './NestedModel', './mixins/cellMixin', './registry'], factory);
      } else if (typeof exports === 'object') {
        module.exports = factory(require('underscore'), require('./NestedModel'), require('./mixins/cellMixin'), require('./registry'));
      } else {
        root.Torso = root.Torso || {};
        root.Torso.NestedCell = factory(root._, root.Torso.NestedModel, root.Torso.Mixins.cell, root.Torso.registry);
      }
    }(this, function(_, TorsoNestedModel, cellMixin, registry) {
      'use strict';
    
      /**
       * Generic Nested Cell
       *
       * @class NestedCell
       * @extends NestedModel
       * @mixes cellMixin
       *
       * @param {Object} attributes the initial attributes to use for this cell.
       * @param {Object} [options={}] the options for setting up this cell.
       *   @param {boolean} [options.register=false] whether to register this cell in the app-level registry.
       *                                             By default this will NOT add it to the registry unless set to true because
       *                                             we have not mechanism that will make sure the models get removed from the registry
       *                                             at the appropriate times.
       * @author kent.willis@vecna.com
       *
       * @see <a href="../annotated/modules/NestedCell.html">NestedCell Annotated Source</a>
       */
      var NestedCell = TorsoNestedModel.extend(/** @lends NestedCell# */{
        /**
         * Register this item with the cell registry after initialize.
         * @private
         * @override
         */
        __register: function() {
          registry.cellInitialized(this);
        }
      });
      _.extend(NestedCell.prototype, cellMixin);
    
      return NestedCell;
    }));