From baf0718e9100765671e0a2ec6c5890aac8a4c717 Mon Sep 17 00:00:00 2001 From: filzrev <103790468+filzrev@users.noreply.github.com> Date: Sat, 2 Mar 2024 15:41:29 +0900 Subject: [PATCH] chore: Don't overwrite `_disabledToc` when metadata is explicitly defined (#9741) * chore: don't overwrite _disabledToc when explicitly defined * chore: remove unused _disableToc metadata --------- Co-authored-by: Yufei Huang --- templates/default/ManagedReference.html.primary.js | 4 +++- templates/default/RestApi.html.primary.js | 4 +++- templates/default/UniversalReference.html.primary.js | 4 +++- templates/default/conceptual.html.primary.js | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/templates/default/ManagedReference.html.primary.js b/templates/default/ManagedReference.html.primary.js index a7e26506e1d..f5b306e9458 100644 --- a/templates/default/ManagedReference.html.primary.js +++ b/templates/default/ManagedReference.html.primary.js @@ -23,7 +23,9 @@ exports.transform = function (model) { model.isClass = false; model.isEnum = true; } - model._disableToc = model._disableToc || !model._tocPath || (model._navPath === model._tocPath); + if(model._disableToc === undefined) { + model._disableToc = model._disableToc || !model._tocPath || (model._navPath === model._tocPath); + } model._disableNextArticle = true; if (extension && extension.postTransform) { diff --git a/templates/default/RestApi.html.primary.js b/templates/default/RestApi.html.primary.js index c2149596a72..b148bb2d919 100644 --- a/templates/default/RestApi.html.primary.js +++ b/templates/default/RestApi.html.primary.js @@ -12,7 +12,9 @@ exports.transform = function (model) { if (restApiCommon && restApiCommon.transform) { model = restApiCommon.transform(model); } - model._disableToc = model._disableToc || !model._tocPath || (model._navPath === model._tocPath); + if(model._disableToc === undefined) { + model._disableToc = model._disableToc || !model._tocPath || (model._navPath === model._tocPath); + } model._disableNextArticle = true; if (extension && extension.postTransform) { diff --git a/templates/default/UniversalReference.html.primary.js b/templates/default/UniversalReference.html.primary.js index 121b48fcf8d..535fbf43846 100644 --- a/templates/default/UniversalReference.html.primary.js +++ b/templates/default/UniversalReference.html.primary.js @@ -13,7 +13,9 @@ exports.transform = function (model) { model = urefCommon.transform(model); } - model._disableToc = model._disableToc || !model._tocPath || (model._navPath === model._tocPath); + if(model._disableToc === undefined) { + model._disableToc = model._disableToc || !model._tocPath || (model._navPath === model._tocPath); + } model._disableNextArticle = true; if (extension && extension.postTransform) { diff --git a/templates/default/conceptual.html.primary.js b/templates/default/conceptual.html.primary.js index b06e0c3a40c..19d24791e6d 100644 --- a/templates/default/conceptual.html.primary.js +++ b/templates/default/conceptual.html.primary.js @@ -9,7 +9,9 @@ exports.transform = function (model) { model = extension.preTransform(model); } - model._disableToc = model._disableToc || !model._tocPath || (model._navPath === model._tocPath); + if(model._disableToc === undefined) { + model._disableToc = model._disableToc || !model._tocPath || (model._navPath === model._tocPath); + } model.docurl = model.docurl || common.getImproveTheDocHref(model, model._gitContribute, model._gitUrlPattern); if (extension && extension.postTransform) {