@rsuite/document-nav
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -90,6 +90,10 @@ 'use strict'; | ||
if (once && !this.props.content && nextProps.content || rtl !== nextProps.rtl) { | ||
this.handelContentMount(nextProps.content); | ||
if (rtl !== nextProps.rtl) { | ||
this.handelContentMount(nextProps.content, nextProps.rtl); | ||
return; | ||
} | ||
if (once && !this.props.content && nextProps.content) { | ||
this.handelContentMount(nextProps.content, nextProps.rtl); | ||
} else if (!once && this.props.content !== nextProps.content) { | ||
this.handelContentMount(nextProps.content); | ||
this.handelContentMount(nextProps.content, nextProps.rtl); | ||
} | ||
@@ -214,3 +218,3 @@ } | ||
key: 'handelContentMount', | ||
value: function handelContentMount(content) { | ||
value: function handelContentMount(content, rtl) { | ||
var titleList = []; | ||
@@ -222,4 +226,3 @@ var anchors = []; | ||
maxLevel = _props5.maxLevel, | ||
fixed = _props5.fixed, | ||
rtl = _props5.rtl; | ||
fixed = _props5.fixed; | ||
@@ -226,0 +229,0 @@ if (!children) { |
{ | ||
"name": "@rsuite/document-nav", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Document navigation is automatically generated based on the HTML title (h1-h6) tag", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -29,3 +29,3 @@ // @flow | ||
showOrderNumber: boolean, | ||
rtl:boolean | ||
rtl: boolean | ||
}; | ||
@@ -85,6 +85,10 @@ | ||
const { once, rtl } = this.props; | ||
if ((once && !this.props.content && nextProps.content) || (rtl !== nextProps.rtl)) { | ||
this.handelContentMount(nextProps.content); | ||
if (rtl !== nextProps.rtl) { | ||
this.handelContentMount(nextProps.content, nextProps.rtl); | ||
return; | ||
} | ||
if (once && !this.props.content && nextProps.content) { | ||
this.handelContentMount(nextProps.content, nextProps.rtl); | ||
} else if (!once && this.props.content !== nextProps.content) { | ||
this.handelContentMount(nextProps.content); | ||
this.handelContentMount(nextProps.content, nextProps.rtl); | ||
} | ||
@@ -187,6 +191,6 @@ } | ||
handelContentMount(content: HTMLElement) { | ||
handelContentMount(content: HTMLElement, rtl) { | ||
const titleList: TitleList = []; | ||
const anchors: Array<string> = []; | ||
const { children, minLevel, maxLevel, fixed, rtl } = this.props; | ||
const { children, minLevel, maxLevel, fixed } = this.props; | ||
if (!children) { | ||
@@ -193,0 +197,0 @@ this.traverseTitle(content, titleList, anchors); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53214
1168