Skip to content

Instantly share code, notes, and snippets.

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 JarbasHorst/57645d4321f952e1ce0fc49ea2b1d940 to your computer and use it in GitHub Desktop.
Save JarbasHorst/57645d4321f952e1ce0fc49ea2b1d940 to your computer and use it in GitHub Desktop.
import { override } from '@microsoft/decorators';
import { Log } from '@microsoft/sp-core-library';
import {
BaseApplicationCustomizer
} from '@microsoft/sp-application-base';
import * as strings from 'HideSiteDesignsMenuEntryApplicationCustomizerStrings';
const LOG_SOURCE: string = 'HideSiteDesignsMenuEntryApplicationCustomizer';
/**
* If your command set uses the ClientSideComponentProperties JSON input,
* it will be deserialized into the BaseExtension.properties object.
* You can define an interface to describe it.
*/
export interface IHideSiteDesignsMenuEntryApplicationCustomizerProperties {
}
/** A Custom Action which can be run during execution of a Client Side Application */
export default class HideSiteDesignsMenuEntryApplicationCustomizer
extends BaseApplicationCustomizer<IHideSiteDesignsMenuEntryApplicationCustomizerProperties> {
@override
public onInit(): Promise<void> {
Log.info(LOG_SOURCE, `Initialized ${strings.Title}`);
var css = document.createElement('style');
css.type = 'text/css';
css.appendChild(document.createTextNode('#O365_SubLink_SUITENAV_SITE_DESIGN, #SUITENAV_SITE_DESIGN, #SuiteMenu_MenuItem_SiteDesigns { display: none }'));
const head: any = document.getElementsByTagName("head")[0] || document.documentElement;
head.appendChild(css);
return Promise.resolve();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment