Changeset 171
- Timestamp:
- 08/20/08 21:28:35 (3 months ago)
- Files:
-
- trunk/microfacts/public/behaviour/app/controllers/factletsearch_controller.js (added)
- trunk/microfacts/public/behaviour/app/controllers/threadfactlets_controller.js (modified) (4 diffs)
- trunk/microfacts/public/behaviour/app/controllers/threadpage_controller.js (modified) (3 diffs)
- trunk/microfacts/public/behaviour/app/models/model.js (modified) (2 diffs)
- trunk/microfacts/public/behaviour/load.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/microfacts/public/behaviour/app/controllers/threadfactlets_controller.js
r163 r171 13 13 onFactletSelect: function (factlet) { 14 14 console.log("ThreadFactletsController saw factletSelect event"); 15 console.log(factlet);16 15 console.log(this.factletDivsKeyedById); 17 16 // TODO: unselect any selected element ... … … 20 19 }); 21 20 var div = this.factletDivsKeyedById[factlet.id]; 22 console.log(div);23 21 div.addClass('active'); 24 console.log(div);25 22 }, 26 23 27 24 onThreadStart: function () { 28 25 console.log("ThreadFactletsController saw threadStart event"); 29 console.log(arguments);30 26 this.thread = arguments[0]; 31 27 this.factlets = arguments[1]; 32 console.log(this.thread);33 console.log(this.factlets);34 28 this.factletsKeyedById = new Hash({}); 35 29 this.factletDivsKeyedById = new Hash({}); … … 46 40 controls: { 47 41 '.factlet click': function (e) { 42 // does not work 43 // this.manageFactletClick(e); 48 44 var evt = new Event(e); 49 45 console.log('Factlet in ThreadFactlets clicked.'); … … 52 48 var factletId = divId.split('-').getLast().toInt(); 53 49 this.fireEvent('factletSelect', this.factletsKeyedById[factletId]); 54 // },55 // '.addToThread': function () {56 // $$('.thread')[0].controller().addFactlet(this.model);57 50 } 58 51 } trunk/microfacts/public/behaviour/app/controllers/threadpage_controller.js
r163 r171 2 2 Extends: Controller, 3 3 4 onFactletSelect: function(factlet) {5 console.log('ThreadPageController: saw factletSelect event');6 console.log(factlet);7 this.fireEvent('factletSelect', factlet);8 },9 10 4 initialize: function (element) { 11 5 this.initModel(); … … 14 8 element.getElements('.thread-factlets').each(function (el) { 15 9 this.addController(new ThreadFactletsController(el)); 10 }, this); 11 // should be only one 12 element.getElements('#factlet-search').each(function (el) { 13 this.addController(new FactletSearchController(el)); 16 14 }, this); 17 15 … … 26 24 onThreadStart: function() { 27 25 console.log('ThreadPageController: onThreadStart'); 28 console.log(arguments);29 26 this.fireEvent('threadStart', arguments); 27 }, 28 29 onFactletSelect: function(factlet) { 30 console.log('ThreadPageController: saw factletSelect event'); 31 this.fireEvent('factletSelect', factlet); 30 32 }, 31 33 trunk/microfacts/public/behaviour/app/models/model.js
r163 r171 4 4 startWithThread: function (payloadThread, payloadThreadFactlets) { 5 5 console.log('Model: startWithThread'); 6 console.log(payloadThread.id);7 6 var thread = new Thread(payloadThread['id']); 8 7 thread.data = payloadThread; … … 18 17 DomainObject.Register['Thread'][thread.id] = thread; 19 18 var evtData = [thread, threadFactlets]; 20 console.log(evtData);21 19 this.fireEvent('threadStart', evtData); 22 20 } trunk/microfacts/public/behaviour/load.js
r169 r171 135 135 136 136 loader.addModule({ 137 name: "factletsearchcontroller", 138 type: "js", 139 path: "app/controllers/factletsearch_controller.js?" + Math.random(), 140 requires: ['controller', 'factlet'], 141 varName: "FactletSearchController" 142 }); 143 144 145 loader.addModule({ 137 146 name: "factletcontroller", 138 147 type: "js", … … 181 190 type: "js", 182 191 path: "app/controllers/threadpage_controller.js?" + Math.random(), 183 requires: ['model', 'domainobject', 'view', 'controller', 'thread', 'factlet', 'threadfactletscontroller' ],192 requires: ['model', 'domainobject', 'view', 'controller', 'thread', 'factlet', 'threadfactletscontroller', 'factletsearchcontroller'], 184 193 varName: "ThreadPageController" 185 194 });
