Sha256: 1f6aecdd042b486ba53179c04ab58e69bfe49138dd505ff6fca4b3370cc9ff3b

Contents?: true

Size: 804 Bytes

Versions: 289

Compression:

Stored size: 804 Bytes

Contents

var Model = function(params) {
  for (var thing in params)
    this[thing] = params[thing];
  
  if (this.options_url)
  {
    for (var attrib in this.options_url)
      this.populate_options(this.options_url[attrib]);
  }
};

Model.prototype = {
  name: false,
  id: false,
  attributes: [],
  attributes_clean: [],
  update_url: false,
  fetch_url: false,
  options_url: false,
  options: false,
  
  save: function(attrib, after) {
    if (!attrib.update_url)
      attrib.update_url = this.update_url;
    attrib.save(after);
  },
  
  populate_options: function(after, i) {
    if (i == null || i == undefined)
      i = 0;
    if (i >= this.attributes.length)
      after();
    var this2 = this;
    this.attributes[i].populate_options(function() { this2.populate_options(after, i+1); });
  }
};

Version data entries

289 entries across 289 versions & 1 rubygems

Version Path
caboose-cms-0.4.90 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.89 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.88 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.87 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.86 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.85 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.84 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.83 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.82 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.81 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.80 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.79 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.78 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.77 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.76 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.75 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.74 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.73 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.72 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.71 app/assets/javascripts/caboose/model/model.js