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