Sha256: cdef9d1ef86e274f98ac6077920a04542b7dd83adeb07c8d57cecc2edfb293f2

Contents?: true

Size: 1.73 KB

Versions: 71

Compression:

Stored size: 1.73 KB

Contents

(function() {

  define(["frank"], function(frank) {
    var ViewModel;
    ViewModel = Backbone.Model.extend({
      defaults: {
        parent: void 0,
        depth: 0
      },
      initialize: function(attributes) {
        var childDepth, childModels, subview;
        childDepth = attributes.depth + 1;
        childModels = (function() {
          var _i, _len, _ref, _results;
          _ref = attributes.subviews;
          _results = [];
          for (_i = 0, _len = _ref.length; _i < _len; _i++) {
            subview = _ref[_i];
            _results.push(new ViewModel(_.extend(subview, {
              parent: this,
              depth: childDepth
            })));
          }
          return _results;
        }).call(this);
        return this.set({
          children: childModels
        });
      },
      getDesc: function() {
        var label, viewClass;
        viewClass = this.get('class');
        if (label = this.get('accessibilityLabel')) {
          return "" + viewClass + ": " + label;
        } else {
          return viewClass;
        }
      },
      getShelleySelector: function() {
        if (this.has('accessibilityLabel')) {
          return "view:'" + (this.get('class')) + "' marked:'" + (this.get('accessibilityLabel')) + "'";
        } else {
          return false;
        }
      },
      getSnapshotUrl: function() {
        return frank.snapshotUrlForViewWithUid(this.get('uid'));
      },
      setActive: function() {
        var _this = this;
        return this.collection.each(function(viewModel) {
          return viewModel.set('active', viewModel === _this);
        });
      },
      unsetActive: function() {
        return this.set('active', false);
      }
    });
    return ViewModel;
  });

}).call(this);

Version data entries

71 entries across 54 versions & 5 rubygems

Version Path
sc-frank-ios-1.2.3 frank-skeleton/frank_static_resources.bundle/js/view_model.js
frank-cucumber-1.2.5 frank-skeleton/frank_static_resources.bundle/js/view_model.js
frank-cucumber-1.2.4.pre1 frank-skeleton/frank_static_resources.bundle/js/view_model.js
frank-pivotal-1.3.0.pre.2 frank-skeleton/frank_static_resources.bundle/js/view_model.js
sc-frank-cucumber-1.2.1.bba52d7.debug frank-skeleton/frank_static_resources.bundle/js/view_model.js
sc-frank-cucumber-1.2.1.e1e3ccb.debug frank-skeleton/frank_static_resources.bundle/js/view_model.js
sc-frank-cucumber-1.2.1.1a856ca.debug frank-skeleton/frank_static_resources.bundle/js/view_model.js
frank-pivotal-1.3.0.pre.1 frank-skeleton/frank_static_resources.bundle/js/view_model.js
frank-pivotal-1.2.4 frank-skeleton/frank_static_resources.bundle/js/view_model.js
frank-pivotal-1.2.3.pre.2 frank-skeleton/frank_static_resources.bundle/js/view_model.js
frank-pivotal-1.2.3.pre.1 frank-skeleton/frank_static_resources.bundle/js/view_model.js
frank-pivotal-1.2.3 frank-skeleton/frank_static_resources.bundle/js/view_model.js
sc-frank-cucumber-1.2.1.b7791c5.debug frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/view_model.js
sc-frank-cucumber-1.2.1.b7791c5.debug frank-skeleton/frank_static_resources.bundle/bundle/js/view_model.js
sc-frank-cucumber-1.2.1.b7791c5.debug frank-skeleton/frank_static_resources.bundle/js/view_model.js
frank-cucumber-1.2.3 frank-skeleton/frank_static_resources.bundle/js/view_model.js
sc-frank-cucumber-1.2.1.3256dc1.debug frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/view_model.js
sc-frank-cucumber-1.2.1.3256dc1.debug frank-skeleton/frank_static_resources.bundle/js/view_model.js
sc-frank-cucumber-1.2.1.3256dc1.debug frank-skeleton/frank_static_resources.bundle/bundle/js/view_model.js
sc-frank-cucumber-1.2.1.9c95c03.debug frank-skeleton/frank_static_resources.bundle/js/view_model.js