Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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