Skip to content

Commit 007f15f

Browse files
committed
v0.0.2 修复版
1 parent bb854d2 commit 007f15f

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

markdown-toc-code/css/content.css

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,24 @@
2020

2121
/* 目录栏的样式 */
2222
.div_toc{
23-
width: -webkit-calc(100% - 6px);
23+
width: -webkit-calc(100% - 5px);
2424
height: 100%;
2525
float: left;
2626
padding: 20px;
2727
overflow: auto;
2828
overflow-x: hidden;
2929
background-color: #fafbfc;
30-
border: 1px solid #d1d5da;
30+
/* border: 1px solid #d1d5da; */
31+
border-right-width: 0;
3132
}
3233

3334
.div_right_bar{
34-
width: 6px;
35+
width: 5px;
3536
height: 100%;
36-
background-color: white;
37-
cursor: e-resize;
37+
background-color: #fafbfc;
38+
cursor: col-resize;
3839
float: left;
40+
border-right: 1px solid #d1d5da;
3941
}
4042

4143
/* 这个地方 */
@@ -46,7 +48,6 @@
4648
min-height: 200px;
4749
z-index: 999;
4850
min-width: 200px;
49-
5051
left: 0px;
5152
top: 0px;
5253
border-radius: 0px;

markdown-toc-code/js/content-script.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ const domInit = function(){
4848

4949
// 因为你这里你根本不知道页面结构到底加载好了没 资源 z加载enme完毕了吗
5050
document.querySelector('.Header').style.paddingLeft = '350px';
51+
// document.querySelector('#js-repo-pjax-container').style.paddingLeft = '350px';
52+
5153

5254
// document.getElementsByTagName('html')[0].style.marginLeft = "350px";
5355
}
@@ -90,7 +92,7 @@ function init(list) {
9092
isGetFisrtLevel = true;
9193

9294
var header_p = document.createElement("li");
93-
header_p.textContent = "Article TOC for GitHub";
95+
header_p.textContent = "GitHub Markdown TOC";
9496
addStyle(header_p, {"listStyle": "none","font-size":"20px","margin-bottom":"10px"});
9597

9698
var gotop_li = document.createElement("li");
@@ -167,6 +169,9 @@ function bindResize(el) {
167169

168170
//移动事件
169171
function mouseMove(e) {
172+
console.log(e);
173+
// document.querySelector('#js-repo-pjax-container').style.paddingLeft = "0px";
174+
// console.log
170175
//宇宙超级无敌运算中...
171176
let w = document.body.clientWidth;
172177
let w2 = e.clientX + 'px';
@@ -186,8 +191,8 @@ function bindResize(el) {
186191
// console.log("e.clientX " + e.clientX);
187192

188193

189-
var readmeWidth = document.getElementById("readme").clientWidth;
190-
var maxWidth = document.getElementById("readme").clientWidth * 0.8;
194+
// var readmeWidth = document.getElementById("readme").clientWidth;
195+
// var maxWidth = document.getElementById("readme").clientWidth * 0.8;
191196
var minWidth = 200;
192197
var moveWidth = parseInt(e.clientX);
193198
if(moveWidth < 200){
@@ -196,8 +201,6 @@ function bindResize(el) {
196201
var $header = document.querySelector('.Header');
197202

198203

199-
200-
201204
if(moveWidth > minWidth && e.clientX > containerClient.left){
202205
document.getElementsByTagName('html')[0].style.marginLeft = w2;
203206
$header.style.paddingLeft = 0 + 'px';

0 commit comments

Comments
 (0)