Skip to content

Instantly share code, notes, and snippets.

@erichocean
Created November 7, 2008 17:38
Show Gist options
  • Save erichocean/22916 to your computer and use it in GitHub Desktop.
Save erichocean/22916 to your computer and use it in GitHub Desktop.
require('core') ;
/**
@mixin
This where we will put all of the State core to keep it centralized.
@extends Cp2
@author Evin Grano
@version 0.1
*/
Cp2.mixin(
/** @scope Cp2 */ {
/** not logged in */
goStateA1: function(){
},
/** load all landing pages */
goStateA2: function(){
SC.page.getPath('workspace.sideCar.masterFooter.addLandingPage').set('isEnabled', true);
SC.page.getPath('fullHeader.controlSegments').set('isEnabled', false);
},
/** no connection to server */
goStateA3: function(){
SC.page.getPath('workspace.sideCar.masterFooter.addLandingPage').set('isEnabled', false);
SC.page.getPath('fullHeader.controlSegments').set('isEnabled', false);
SC.page.getPath('workspace.sideCar.masterFooter.landingPageSettings').set('isEnabled', false);
},
/** No Landing Pages */
goStateA4: function(){
SC.page.getPath('fullHeader.controlSegments').set('isEnabled', false); //enable style,content,preview
SC.page.getPath('workspace.sideCar.masterFooter.addLandingPage').set('isEnabled', true);
SC.page.getPath('workspace.sideCar.masterFooter.landingPageInfo').set('isEnabled', true);
SC.page.getPath('workspace.sideCar.masterFooter.landingPageSettings').set('isEnabled', false);
},
/** Has Landing Pages */
goStateA5: function(){
SC.page.getPath('fullHeader.controlSegments').set('isEnabled', true); //enable style,content,preview
SC.page.getPath('workspace.sideCar.masterFooter.addLandingPage').set('isEnabled', true);
SC.page.getPath('workspace.sideCar.masterFooter.landingPageInfo').set('isEnabled', true);
SC.page.getPath('workspace.sideCar.masterFooter.landingPageSettings').set('isEnabled', true);
},
/** State C Landing Page Settings */
goStateC: function(){
SC.page.getPath('workspace.sideCar.masterFooter.addLandingPage').set('isEnabled', false);
SC.page.getPath('workspace.sideCar.masterFooter.landingPageInfo').set('isEnabled', false);
SC.page.getPath('workspace.sideCar.masterFooter.landingPageSettings').set('isEnabled', true);
},
/** State E Landing Page Preview */
goStateE: function(){
SC.page.getPath('fullHeader.controlSegments').set('isEnabled', true); //enable style,content,preview
SC.page.getPath('workspace.sideCar.masterFooter.addLandingPage').set('isEnabled', true);
SC.page.getPath('workspace.sideCar.masterFooter.landingPageInfo').set('isEnabled', true);
SC.page.getPath('workspace.sideCar.masterFooter.landingPageSettings').set('isEnabled', true);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment