@jx3box/jx3box-editor 1.7.6 → 1.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -118,3 +118,13 @@
|
|
|
118
118
|
.c-article .isScrollFocus {
|
|
119
119
|
animation: focusFade 0.5s ease-in-out;
|
|
120
120
|
}
|
|
121
|
+
|
|
122
|
+
.w-directory-anchor{
|
|
123
|
+
.fz(16px);
|
|
124
|
+
.pointer;
|
|
125
|
+
color:@color !important;
|
|
126
|
+
&:hover{
|
|
127
|
+
box-shadow:none !important;
|
|
128
|
+
color:#c00 !important;
|
|
129
|
+
}
|
|
130
|
+
}
|
package/assets/js/directory.js
CHANGED
|
@@ -9,6 +9,7 @@ const count = {
|
|
|
9
9
|
};
|
|
10
10
|
const MAX_DEPTH = 3;
|
|
11
11
|
const PREFIX_CLS = "lv"; //class前缀
|
|
12
|
+
const HEADER_HEIGHT = 112; //头部高度
|
|
12
13
|
|
|
13
14
|
function directory(from, to = '#directory') {
|
|
14
15
|
// 装载容器设置
|
|
@@ -50,7 +51,7 @@ function directory(from, to = '#directory') {
|
|
|
50
51
|
// 进行克隆
|
|
51
52
|
let _item = $(item).clone();
|
|
52
53
|
// 解决懒加载跳转位置问题
|
|
53
|
-
$(item).
|
|
54
|
+
$(item).prepend(`<a id="directory-${i}" class="el-icon-s-flag w-directory-anchor"></a>`);
|
|
54
55
|
|
|
55
56
|
// 过滤行内样式
|
|
56
57
|
_item.removeAttr("style");
|
|
@@ -80,7 +81,7 @@ function directory(from, to = '#directory') {
|
|
|
80
81
|
let target = $(this)
|
|
81
82
|
.data("raw")
|
|
82
83
|
.offset().top;
|
|
83
|
-
$(document).scrollTop(target -
|
|
84
|
+
$(document).scrollTop(target - HEADER_HEIGHT);
|
|
84
85
|
$(this)
|
|
85
86
|
.data("raw")
|
|
86
87
|
.addClass("isScrollFocus");
|
package/package.json
CHANGED
package/src/Article.vue
CHANGED
|
@@ -62,6 +62,9 @@
|
|
|
62
62
|
</template>
|
|
63
63
|
|
|
64
64
|
<script>
|
|
65
|
+
import $ from "jquery";
|
|
66
|
+
const HEADER_HEIGHT = 112; //头部高度
|
|
67
|
+
|
|
65
68
|
import { Pagination, Button, Popover } from "element-ui";
|
|
66
69
|
import "@jx3box/jx3box-common/css/element.css";
|
|
67
70
|
|
|
@@ -224,6 +227,12 @@ export default {
|
|
|
224
227
|
}
|
|
225
228
|
let dir = renderDirectory(target, this.directorybox);
|
|
226
229
|
this.$emit("directoryRendered",dir);
|
|
230
|
+
|
|
231
|
+
$('.w-directory-anchor').on('click', function(){
|
|
232
|
+
let id = $(this).attr('id')
|
|
233
|
+
let target = $(`#${id}`).offset().top;
|
|
234
|
+
$(document).scrollTop(target - HEADER_HEIGHT);
|
|
235
|
+
})
|
|
227
236
|
},
|
|
228
237
|
changePage: function (i) {
|
|
229
238
|
this.page = i;
|