Skip to content

Instantly share code, notes, and snippets.

@spdustin
Created October 31, 2012 16:25
Show Gist options
  • Save spdustin/3988056 to your computer and use it in GitHub Desktop.
Save spdustin/3988056 to your computer and use it in GitHub Desktop.
WIP - SPE Util Singleton
var SPE = {
DesignHelpers: {
Classes: {
site: "site" + _spPageContextInfo.siteServerRelativeUrl.replace(/\W/g, "-"),
web: "web" +_spPageContextInfo.webServerRelativeUrl.replace(/\W/g, "-"),
pagestate: "page-state-" + (SP.Ribbon.PageState.Handlers.isInEditMode() == false) ? "view" : "edit"
}
}
};
@spdustin
Copy link
Author

Try:
console.log(SPE.DesignHelpers.Classes.pagestate);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment