Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
Allowing controller to be specified as a class, this allows users to …
Browse files Browse the repository at this point in the history
…extend other controllers through Y.extend, while maintaining the prototype chain.
  • Loading branch information
aljimenez committed Jun 27, 2014
1 parent b1605c4 commit 4ca8a34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/app/autoload/dispatch.server.js
Expand Up @@ -4,7 +4,7 @@
* See the accompanying LICENSE file for terms.
*/

/*jslint anon:true, nomen:true*/
/*jslint anon:true, nomen:true, newcap:true */
/*global YUI*/


Expand Down Expand Up @@ -66,7 +66,7 @@ YUI.add('mojito-dispatcher', function (Y, NAME) {
try {
ac = new Y.mojito.ActionContext({
command: command,
controller: Y.mojito.util.heir(controller),
controller: Y.Lang.isFunction(controller) ? new controller() : Y.mojito.util.heir(controller),
dispatcher: this, // NOTE passing dispatcher.
adapter: adapter,
store: this.store
Expand Down

0 comments on commit 4ca8a34

Please sign in to comment.