diff --git a/lib/App.js b/lib/App.js index b6888f58..c3530ba6 100644 --- a/lib/App.js +++ b/lib/App.js @@ -253,6 +253,11 @@ App.prototype.component = function(name, constructor, isDependency) { } } } + + // Load style for component + if (constructor.prototype.style) { + this.loadStyles(constructor.prototype.style); + } // Register or find views specified by the component var view; diff --git a/lib/AppForServer.js b/lib/AppForServer.js index 7d5211c3..0156569e 100644 --- a/lib/AppForServer.js +++ b/lib/AppForServer.js @@ -342,8 +342,17 @@ AppForServer.prototype._updateScriptViews = function() { AppForServer.prototype._autoRefresh = function(backend) { var agents = this.agents = {}; var app = this; - + backend.use('receive', function(request, next) { + if (request.data.derby) { + return backend.trigger('derby_debug', request.agent, {data:request.data}, function(err) { + // All apps triggered derby_debug + }); + } + next(); + }); + + backend.use('derby_debug', function(request, next) { var data = request.data; if (data.derby) { app._handleMessage(request.agent, data.derby, data);