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.111 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.110 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.109 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.108 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.106 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.105 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.104 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.103 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.102 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.101 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.100 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.99 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.98 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.97 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.96 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.95 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.94 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.93 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.92 app/assets/javascripts/caboose/model/model.js
caboose-cms-0.4.91 app/assets/javascripts/caboose/model/model.js