2 changes: 1 addition & 1 deletion js/toc.js
2 changes: 1 addition & 1 deletion js/vendors~html2canvas.js

Large diffs are not rendered by default.

11,038 changes: 2,099 additions & 8,939 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mdx",
"version": "2.0.3",
"version": "2.0.4",
"description": "",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
Expand Down
14 changes: 9 additions & 5 deletions src/toc.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,17 @@ function addToc(titleList) {

const debouncedReflow = debounce(() => {
const tabEle = ele('#mdx-toc-select');
const halfWidth = tabEle.clientWidth / 2;
const borderEle = tabEle.getElementsByClassName('mdui-tab-indicator')[0];
if (tabEle) {
const halfWidth = tabEle.clientWidth / 2;
const borderEle = tabEle.getElementsByClassName('mdui-tab-indicator')[0];

if (borderEle.style.left !== '0px') {
borderEle.style.left = `${halfWidth}px`;
if (borderEle) {
if (borderEle.style.left !== '0px') {
borderEle.style.left = `${halfWidth}px`;
}
borderEle.style.width = `${halfWidth}px`;
}
}
borderEle.style.width = `${halfWidth}px`;
}, 300);

window.addEventListener('resize', function () {
Expand Down
4 changes: 2 additions & 2 deletions style.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const path = require('path');
const webpack = require('webpack');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');

const mdxVersion = '2.0.3';
const mdxVersion = '2.0.4';

module.exports = {
entry: {
Expand All @@ -22,7 +22,7 @@ module.exports = {
optimization: {
splitChunks: {
cacheGroups: {
common: {
common: {
name: 'common',
chunks (chunk) {
return chunk.name !== 'login';
Expand Down