@mikezimm/npmfunctions
Version:
Functions used in my SPFx webparts
30 lines • 1.63 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.expandoOnInit = void 0;
var sp_core_library_1 = require("@microsoft/sp-core-library");
var FPSExpandoramic_1 = require("./FPSExpandoramic");
//Use this to add more console.logs for this component
var urlParams = new URLSearchParams(window.location.search);
var fpsconsole = urlParams.get('fpsconsole') === 'true' ? true : false;
var consolePrefix = 'fpsconsole: expandoOnInit';
function expandoOnInit(thisProps, domElement, displayMode) {
if (fpsconsole === true)
console.log("".concat(consolePrefix, " ~ 23: webpart props:"), thisProps);
// DEFAULTS SECTION: Expandoramic <<< ================================================================
var expandoDefault = thisProps.expandoDefault === true && thisProps.enableExpandoramic === true && displayMode === sp_core_library_1.DisplayMode.Read ? true : false;
if (displayMode === sp_core_library_1.DisplayMode.Edit) {
expandoDefault = false;
}
var expandoStyle = {};
//2022-04-07: Could use the function for parsing JSON for this... check npmFunctions
try {
expandoStyle = JSON.parse(thisProps.expandoStyle);
}
catch (e) {
console.log('Unable to expandoStyle: ', thisProps.expandoStyle);
}
var padding = thisProps.expandoPadding ? thisProps.expandoPadding : 20;
(0, FPSExpandoramic_1.setExpandoRamicMode)(domElement, expandoDefault, expandoStyle, false, false, padding, thisProps.pageLayout);
}
exports.expandoOnInit = expandoOnInit;
//# sourceMappingURL=WebPartOnInit.js.map