Skip to content

Commit

Permalink
chore: Don't overwrite _disabledToc when metadata is explicitly def…
Browse files Browse the repository at this point in the history
…ined (#9741)

* chore: don't overwrite _disabledToc when explicitly defined

* chore: remove unused _disableToc metadata

---------

Co-authored-by: Yufei Huang <yufeih@live.com>
  • Loading branch information
filzrev and yufeih authored Mar 2, 2024
1 parent c40672b commit baf0718
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion templates/default/ManagedReference.html.primary.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 3 additions & 1 deletion templates/default/RestApi.html.primary.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 3 additions & 1 deletion templates/default/UniversalReference.html.primary.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 3 additions & 1 deletion templates/default/conceptual.html.primary.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit baf0718

Please sign in to comment.