autumnnote 1.2.0 → 1.2.1

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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Autumn Note
2
2
 
3
- <p align="center"><img src="image/banner.png" width="120" alt="AutumnNote Banner"/></p>
3
+ <p align="center"><img src="public/image/banner.png" width="120" alt="AutumnNote Banner"/></p>
4
4
 
5
5
  [![npm](https://img.shields.io/npm/v/autumnnote?label=version&color=blue&logo=npm)](https://www.npmjs.com/package/autumnnote)
6
6
  [![npm downloads](https://img.shields.io/npm/dw/autumnnote?label=downloads%2Fweek&logo=npm&color=cb3837)](https://www.npmjs.com/package/autumnnote)
@@ -5840,6 +5840,7 @@ var Toolbar = class {
5840
5840
  const openPopup = () => {
5841
5841
  isOpen = true;
5842
5842
  const rect = btn.getBoundingClientRect();
5843
+ popup.style.visibility = "hidden";
5843
5844
  popup.style.display = "block";
5844
5845
  const pw = popup.offsetWidth;
5845
5846
  const ph = popup.offsetHeight;
@@ -5849,13 +5850,12 @@ var Toolbar = class {
5849
5850
  if (top + ph > window.innerHeight - 8) top = rect.top - ph - 4;
5850
5851
  popup.style.left = `${left}px`;
5851
5852
  popup.style.top = `${top}px`;
5853
+ popup.style.visibility = "";
5852
5854
  btn.setAttribute("aria-expanded", "true");
5853
5855
  };
5854
5856
  const closePopup = () => {
5855
5857
  isOpen = false;
5856
5858
  popup.style.display = "none";
5857
- popup.style.top = "";
5858
- popup.style.left = "";
5859
5859
  btn.setAttribute("aria-expanded", "false");
5860
5860
  setHighlight(0, 0);
5861
5861
  };
@@ -5882,9 +5882,11 @@ var Toolbar = class {
5882
5882
  const d5 = on(document, "click", () => {
5883
5883
  if (isOpen) closePopup();
5884
5884
  });
5885
- this._disposers.push(d1, d2, d3, d4, d5);
5885
+ this._disposers.push(d1, d2, d3, d4, d5, () => {
5886
+ if (popup.parentNode) popup.parentNode.removeChild(popup);
5887
+ });
5886
5888
  wrap.appendChild(btn);
5887
- wrap.appendChild(popup);
5889
+ document.body.appendChild(popup);
5888
5890
  return wrap;
5889
5891
  }
5890
5892
  /**