Sha256: 253b0981ec889c79a5d2526bf220276fd7d53ac5a7aea45a9cf0f1129495497e

Contents?: true

Size: 1.66 KB

Versions: 71

Compression:

Stored size: 1.66 KB

Contents

(function() {
  var INTERESTING_PROPERTIES, IRREGULAR_PROPERTIES, renderListItem;

  INTERESTING_PROPERTIES = ['class', 'accessibilityLabel', 'tag', 'alpha', 'isHidden'];

  IRREGULAR_PROPERTIES = INTERESTING_PROPERTIES.concat('parent', 'subviews', 'children');

  renderListItem = function(propertyName, propertyValue, cssClass) {
    if (propertyValue == null) {
      propertyValue = 'null';
    }
    if (_.isObject(propertyValue)) {
      propertyValue = JSON.stringify(propertyValue);
    }
    return $("<li>").addClass(cssClass).append($('<div/>').addClass('key').text(propertyName), $('<div/>').addClass('value').text(propertyValue));
  };

  define(function() {
    var DetailsView;
    DetailsView = Backbone.View.extend({
      el: $('#dom-detail'),
      updateModel: function(model) {
        this.model = model;
        return this.refresh();
      },
      refresh: function() {
        var $ul, prop, val, _i, _j, _len, _len1, _ref;
        $ul = $('<ul>');
        for (_i = 0, _len = INTERESTING_PROPERTIES.length; _i < _len; _i++) {
          prop = INTERESTING_PROPERTIES[_i];
          if (this.model.has(prop)) {
            val = this.model.get(prop);
            $ul.append(renderListItem(prop, val, 'interesting'));
          }
        }
        _ref = _.keys(this.model.attributes).sort();
        for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
          prop = _ref[_j];
          if (_.contains(IRREGULAR_PROPERTIES, prop)) {
            continue;
          }
          val = this.model.get(prop);
          $ul.append(renderListItem(prop, val));
        }
        return this.$el.empty().append($ul);
      }
    });
    return DetailsView;
  });

}).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/details_view.js
frank-cucumber-1.2.5 frank-skeleton/frank_static_resources.bundle/js/details_view.js
frank-cucumber-1.2.4.pre1 frank-skeleton/frank_static_resources.bundle/js/details_view.js
frank-pivotal-1.3.0.pre.2 frank-skeleton/frank_static_resources.bundle/js/details_view.js
sc-frank-cucumber-1.2.1.bba52d7.debug frank-skeleton/frank_static_resources.bundle/js/details_view.js
sc-frank-cucumber-1.2.1.e1e3ccb.debug frank-skeleton/frank_static_resources.bundle/js/details_view.js
sc-frank-cucumber-1.2.1.1a856ca.debug frank-skeleton/frank_static_resources.bundle/js/details_view.js
frank-pivotal-1.3.0.pre.1 frank-skeleton/frank_static_resources.bundle/js/details_view.js
frank-pivotal-1.2.4 frank-skeleton/frank_static_resources.bundle/js/details_view.js
frank-pivotal-1.2.3.pre.2 frank-skeleton/frank_static_resources.bundle/js/details_view.js
frank-pivotal-1.2.3.pre.1 frank-skeleton/frank_static_resources.bundle/js/details_view.js
frank-pivotal-1.2.3 frank-skeleton/frank_static_resources.bundle/js/details_view.js
sc-frank-cucumber-1.2.1.b7791c5.debug frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/details_view.js
sc-frank-cucumber-1.2.1.b7791c5.debug frank-skeleton/frank_static_resources.bundle/bundle/js/details_view.js
sc-frank-cucumber-1.2.1.b7791c5.debug frank-skeleton/frank_static_resources.bundle/js/details_view.js
frank-cucumber-1.2.3 frank-skeleton/frank_static_resources.bundle/js/details_view.js
sc-frank-cucumber-1.2.1.3256dc1.debug frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/details_view.js
sc-frank-cucumber-1.2.1.3256dc1.debug frank-skeleton/frank_static_resources.bundle/js/details_view.js
sc-frank-cucumber-1.2.1.3256dc1.debug frank-skeleton/frank_static_resources.bundle/bundle/js/details_view.js
sc-frank-cucumber-1.2.1.9c95c03.debug frank-skeleton/frank_static_resources.bundle/js/details_view.js