Changeset 100
- Timestamp:
- 04/25/08 21:59:45 (7 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/microfacts/public/app/controllers/factlet_info_controller.js
r86 r100 16 16 }, 17 17 updateViewFor: function (id) { 18 Factlet.entityGet(id).callback(function ( ) {19 var html = this.renderView('factlet/factlet', Factlet.get(id));18 Factlet.entityGet(id).callback(function (factlet) { 19 var html = this.renderView('factlet/factlet', factlet); 20 20 this.element.set('html', html); 21 21 }, this).send(); trunk/microfacts/public/app/lib/model.js
r86 r100 13 13 responseObject, 14 14 responseText); 15 fn.bind(binding)( );15 fn.bind(binding)(responseObject); 16 16 }); 17 17 this.addEvent('onSuccess', function (responseObject, responseText) { … … 20 20 responseObject, 21 21 responseText); 22 fn.bind(binding)( );22 fn.bind(binding)(responseObject); 23 23 }); 24 return this; 25 } 26 }); 27 28 CallbackWrapper = new Class({ 29 initialize: function (object) { 30 this.object = object; 31 }, 32 callback: function(fn, binding) { 33 this.fn = fn.bind(binding); 34 return this; 35 }, 36 send: function () { 37 this.fn(this.object); 24 38 return this; 25 39 } … … 44 58 this.entities = new Hash(); 45 59 this.addEvents(this.options.events); 46 },47 get: function (id) {48 return this.entities.get(id);49 60 }, 50 61 registerGet: function () { trunk/microfacts/public/app/views/thread/factlet-list.ejs
r88 r100 1 1 <% if (c.factlets.length > 0) { %> 2 2 <div class="thread-factlets"> 3 4 3 <% $each(c.factlets, function (factlet, idx) { %> 5 <% console.log(factlet); %>6 4 <div id="factlet-<%= factlet.id %>" class="factlet"> 7 5 <h3 class="factlet-title"><%= factlet.title %></h3>
