Sha256: a1f56cfda83aec5bd5c043a58d5e5f7abec5332430fcb94812b28a72ea437019

Contents?: true

Size: 1.02 KB

Versions: 38

Compression:

Stored size: 1.02 KB

Contents

o_O.dom = {
  save: function(object, callback){
    if(typeof callback === 'function')
    {
      callback(object);
    }
    return object;
  },
  all: function(model, callback){
    var output = [];
    $('[data-model=' + model.model_name + ']').each(function(){
      output.push(model.initialize(o_O.find_attributes($(this), function(field) { return field.text();})))
    })
    if(typeof callback === 'function')
    {
      callback(output);
    }
  },
  destroy: function(object, callback){
    $('[data-model=' + object.model_name +'][data-id= ' + object.id + ']').remove()
    if(typeof callback === 'function')
    {
      callback(object);
    }
  },
  find: function(model, id, callback){
    var template = $('[data-model=' + model.model_name + '][data-id=' + id + ']');
    var new_object;
    if(typeof callback === 'function')
    {
      new_object = model.initialize(o_O.find_attributes(template, function(field){return field.text();}));
      new_object.id = id;
      callback(new_object);
    }
    return new_object;
  }
}

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
eyeballs-0.5.17 src/drivers/jquery/adapters/o_O.dom.js
eyeballs-0.5.16 src/drivers/jquery/adapters/o_O.dom.js
eyeballs-0.5.15 src/drivers/jquery/adapters/o_O.dom.js
eyeballs-0.5.14 src/drivers/jquery/adapters/o_O.dom.js
eyeballs-0.5.13.2 src/drivers/jquery/adapters/o_O.dom.js
eyeballs-0.5.13.1 src/drivers/jquery/adapters/o_O.dom.js
eyeballs-0.5.13 src/drivers/jquery/adapters/o_O.dom.js
eyeballs-0.5.12.1 src/drivers/jquery/adapters/o_O.dom.js
eyeballs-0.5.12 src/drivers/jquery/adapters/o_O.dom.js
eyeballs-0.5.11 src/drivers/jquery/adapters/o_O.dom.js
eyeballs-0.5.10.1 src/drivers/jquery/adapters/o_O.dom.js
eyeballs-0.5.10 src/drivers/jquery/adapters/o_O.dom.js
eyeballs-0.5.9 src/drivers/jquery/adapters/o_O.dom.js
eyeballs-0.5.8.2 src/drivers/jquery/adapters/o_O.dom.js
eyeballs-0.5.8.1 src/drivers/jquery/adapters/o_O.dom.js
eyeballs-0.5.8 src/drivers/jquery/adapters/o_O.dom.js
eyeballs-0.5.7.2 src/drivers/jquery/adapters/o_O.dom.js
eyeballs-0.5.7.1 src/drivers/jquery/adapters/o_O.dom.js
eyeballs-0.5.7 src/drivers/jquery/adapters/o_O.dom.js
eyeballs-0.5.6.1 src/drivers/jquery/adapters/o_O.dom.js