Merge pull request #3030 from nils-a/feature/GH-3029
(#3029) Modify the way "empty" headings are detected
This commit is contained in:
commit
64b745d7d4
|
@ -87,7 +87,7 @@ export class SPService {
|
||||||
/* Traverse through all the Text web parts in the page */
|
/* Traverse through all the Text web parts in the page */
|
||||||
canvasContent1JSON.map((webPart) => {
|
canvasContent1JSON.map((webPart) => {
|
||||||
if (webPart.zoneGroupMetadata && webPart.zoneGroupMetadata.type === 1) {
|
if (webPart.zoneGroupMetadata && webPart.zoneGroupMetadata.type === 1) {
|
||||||
const headingIsEmpty: boolean = webPart.zoneGroupMetadata.displayName === '';
|
const headingIsEmpty: boolean = !webPart.zoneGroupMetadata.displayName;
|
||||||
const headingValue: string = headingIsEmpty ? 'Empty Heading' : webPart.zoneGroupMetadata.displayName ;
|
const headingValue: string = headingIsEmpty ? 'Empty Heading' : webPart.zoneGroupMetadata.displayName ;
|
||||||
const anchorUrl: string = this.GetAnchorUrl(headingValue);
|
const anchorUrl: string = this.GetAnchorUrl(headingValue);
|
||||||
this.allUrls.push(anchorUrl);
|
this.allUrls.push(anchorUrl);
|
||||||
|
@ -104,7 +104,7 @@ export class SPService {
|
||||||
const hasCollapsableHeader: boolean = webPart.zoneGroupMetadata &&
|
const hasCollapsableHeader: boolean = webPart.zoneGroupMetadata &&
|
||||||
webPart.zoneGroupMetadata.type === 1 &&
|
webPart.zoneGroupMetadata.type === 1 &&
|
||||||
( anchorLinks.filter(x => x.name === webPart.zoneGroupMetadata.displayName).length === 1 ||
|
( anchorLinks.filter(x => x.name === webPart.zoneGroupMetadata.displayName).length === 1 ||
|
||||||
webPart.zoneGroupMetadata.displayName === '' );
|
!webPart.zoneGroupMetadata.displayName );
|
||||||
|
|
||||||
const htmlObject: HTMLDivElement = document.createElement('div');
|
const htmlObject: HTMLDivElement = document.createElement('div');
|
||||||
htmlObject.innerHTML = HTMLString;
|
htmlObject.innerHTML = HTMLString;
|
||||||
|
|
Loading…
Reference in New Issue