Skip to content

Instantly share code, notes, and snippets.

@awsp
Created May 14, 2014 19:53
Show Gist options
  • Save awsp/b066c29709dfadd7fd23 to your computer and use it in GitHub Desktop.
Save awsp/b066c29709dfadd7fd23 to your computer and use it in GitHub Desktop.
MyApp.HAS_AUTH = SC.State.design({
initialSubstate: 'SHOWING_APP',
SHOWING_APP: SC.State.design({
substates: [
SC.State.design({
enterState: function() {
var pane = SC.AlertPane.warn({
message: "Could not load calendar",
description: "Your internet connection may be unavailable or our servers may be down.",
caption: "Try again in a few minutes.",
buttons: [
{
title: "OK",
//action: "didClickOK",
//target: MyApp.calendarController
}
]
}, this);
pane.append();
},
exitState: function() {
}
})
],
enterState: function () {
// Step 1: Instantiate Your Views
// The default code here will make the mainPane for your application visible
// on screen. If you app gets any level of complexity, you will probably
// create multiple pages and panes.
MyApp.getPath('mainPage.mainPane').append();
// Step 2. Set the content property on your primary controller.
// This will make your app come alive!
//
// ex.
var tabs = MyApp.store.find(MyApp.MonthlyTab);
MyApp.monthlyTabsController.set('content', tabs);
},
exitState: function () {
MyApp.getPath('mainPage.mainPane').remove();
},
logoutAction: function() {
//this.getSubstate('LOGOUT_CONFIRMATION');
console.log(this.hasSubstates());
}
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment