@jx3box/jx3box-editor 1.8.3 → 1.8.4

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.
@@ -51,7 +51,7 @@ function directory(from, to = '#directory') {
51
51
  // 进行克隆
52
52
  let _item = $(item).clone();
53
53
  // 解决懒加载跳转位置问题
54
- $(item).prepend(`<a id="directory-${i}" class="w-directory-anchor"></a>`);
54
+ $(item).prepend(`<a id="directory-${i}" class="el-icon-link w-directory-anchor"></a>`);
55
55
 
56
56
  // 过滤行内样式
57
57
  _item.removeAttr("style");
@@ -77,7 +77,9 @@ function directory(from, to = '#directory') {
77
77
  });
78
78
 
79
79
  // 进行事件委托
80
- $directory.on("click", "h1,h2,h3,h4,h5,h6", function() {
80
+ $directory.on("click", "h1,h2,h3,h4,h5,h6", function(e) {
81
+ e.preventDefault();
82
+ window.location.hash = $(this).data("raw").find('a[id^="directory-"]').first().attr('id')
81
83
  let target = $(this)
82
84
  .data("raw")
83
85
  .offset().top;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-editor",
3
- "version": "1.8.3",
3
+ "version": "1.8.4",
4
4
  "description": "JX3BOX Article & Editor",
5
5
  "main": "index.js",
6
6
  "scripts": {