Skip to content

Commit

Permalink
changed startApplication to expect an object passed in with namespace…
Browse files Browse the repository at this point in the history
… and delegate properties
  • Loading branch information
jayphelps committed May 9, 2012
1 parent 5a80903 commit e8e1c85
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Application.js
Expand Up @@ -40,12 +40,11 @@ MLImport("Pane.js");
* @author Jay Phelps
* @since 0.1
*/
var startApplication = function (appNamespace, appDelegateName) {
appNamespace = appNamespace || window;
var startApplication = function (options) {
var appNamespace = (options.namespace && window[options.namespace]) || window;
var delegate = appNamespace[options.delegate];

var delegate = appNamespace[appDelegateName];

if (!delegate.isClass || !ML.isFunction(delegate)) throw Error("Delegate is not a class");
if (!delegate || !delegate.isClass || !ML.isFunction(delegate)) throw Error("Application Delegate missing or not a class");

var delegateInstance = new delegate();

Expand Down

0 comments on commit e8e1c85

Please sign in to comment.