Skip to content

Instantly share code, notes, and snippets.

@guilhermeblanco
Created January 9, 2012 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guilhermeblanco/1584994 to your computer and use it in GitHub Desktop.
Save guilhermeblanco/1584994 to your computer and use it in GitHub Desktop.
Page in PureMVC
Object.declare('base.page.index.IndexStartupCommand');
base.page.index.IndexStartupCommand = function ()
{
base.page.PageMacroCommand.call(this);
};
Object.extend(base.page.index.IndexStartupCommand, base.page.PageMacroCommand);
var _p = base.page.index.IndexStartupCommand.prototype;
_p._initializeMacroCommand = function ()
{
base.page.PageMacroCommand.prototype._initializeMacroCommand.call(this);
// Initialize page only widgets here
//this.addSubCommand(base.widget.otherWidget.Command);
};
Object.declare('base.page.PageMacroCommand');
base.page.PageMacroCommand = function ()
{
org.puremvc.js.patterns.command.MacroCommand.call(this);
}
Object.extend(base.page.PageMacroCommand, org.puremvc.js.patterns.command.MacroCommand);
var _p = base.page.PageMacroCommand.prototype;
_p._initializeMacroCommand = function ()
{
// Initialize app-wide generic behavior
$("html").removeClass("no-js").addClass("js");
// Initialize app-wide widgets
this.addSubCommand(base.widget.sampleWidget.Command);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment