Skip to content

Commit 558bd83

Browse files
committed
fix: set label to none will not show edit button
1 parent 3f3d3d4 commit 558bd83

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ The label of a draw.io image block can be configured in the plugin settings.
8181

8282
## Changelog
8383

84+
+ v0.6.5
85+
+ Fix: set label to none will not show edit button
8486
+ v0.6.4
8587
+ Feature: Add edit button to image right top
8688
+ v0.6.3

README_zh_CN.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@
7272

7373
## 更新日志
7474

75+
+ v0.6.5
76+
+ 修复缺陷:设置不显示标签时图片右上角编辑按钮也不显示
7577
+ v0.6.4
7678
+ 新增功能:图片右上角编辑按钮
7779
+ v0.6.3

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "siyuan-embed-drawio",
3-
"version": "0.6.4",
3+
"version": "0.6.5",
44
"type": "module",
55
"description": "This is a plugin for siyuan",
66
"author": "",

plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "siyuan-embed-drawio",
33
"author": "Yuxin Zhao",
44
"url": "https://github.com/YuxinZhaozyx/siyuan-embed-drawio",
5-
"version": "0.6.4",
5+
"version": "0.6.5",
66
"minAppVersion": "3.0.0",
77
"disabledInPublish": true,
88
"backends": [

src/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,13 @@ export default class DrawioPlugin extends Plugin {
6767
this.initSetting();
6868

6969
this._mutationObserver = this.setAddImageBlockMuatationObserver(document.body, (blockElement: HTMLElement) => {
70-
if (this.data[STORAGE_NAME].labelDisplay === "noLabel") return;
71-
7270
const imageElement = blockElement.querySelector("img") as HTMLImageElement;
7371
if (imageElement) {
7472
const imageURL = imageElement.getAttribute("data-src");
7573
this.getDrawioImageInfo(imageURL, false).then((imageInfo) => {
7674
if (imageInfo) {
77-
this.updateAttrLabel(imageInfo, blockElement);
75+
if (this.data[STORAGE_NAME].labelDisplay !== "noLabel") this.updateAttrLabel(imageInfo, blockElement);
76+
7877
const actionElement = blockElement.querySelector(".protyle-action") as HTMLElement;
7978
if (actionElement) {
8079
const editBtnElement = HTMLToElement(`<span aria-label="${this.i18n.editDrawio}" data-position="4north" class="ariaLabel protyle-icon"><svg><use xlink:href="#iconEdit"></use></svg></span>`);

0 commit comments

Comments
 (0)