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 +1 -1
- package/dist/autumnnote.es.js +6 -4
- package/dist/autumnnote.es.js.map +1 -1
- package/dist/autumnnote.umd.js +6 -4
- package/dist/autumnnote.umd.js.map +1 -1
- package/dist/image/banner.png +0 -0
- package/dist/image/favicon.ico +0 -0
- package/package.json +1 -1
- package/src/js/module/Toolbar.js +14 -7
package/dist/autumnnote.umd.js
CHANGED
|
@@ -5558,6 +5558,7 @@
|
|
|
5558
5558
|
const openPopup = () => {
|
|
5559
5559
|
isOpen = true;
|
|
5560
5560
|
const rect = btn.getBoundingClientRect();
|
|
5561
|
+
popup.style.visibility = "hidden";
|
|
5561
5562
|
popup.style.display = "block";
|
|
5562
5563
|
const pw = popup.offsetWidth;
|
|
5563
5564
|
const ph = popup.offsetHeight;
|
|
@@ -5567,13 +5568,12 @@
|
|
|
5567
5568
|
if (top + ph > window.innerHeight - 8) top = rect.top - ph - 4;
|
|
5568
5569
|
popup.style.left = `${left}px`;
|
|
5569
5570
|
popup.style.top = `${top}px`;
|
|
5571
|
+
popup.style.visibility = "";
|
|
5570
5572
|
btn.setAttribute("aria-expanded", "true");
|
|
5571
5573
|
};
|
|
5572
5574
|
const closePopup = () => {
|
|
5573
5575
|
isOpen = false;
|
|
5574
5576
|
popup.style.display = "none";
|
|
5575
|
-
popup.style.top = "";
|
|
5576
|
-
popup.style.left = "";
|
|
5577
5577
|
btn.setAttribute("aria-expanded", "false");
|
|
5578
5578
|
setHighlight(0, 0);
|
|
5579
5579
|
};
|
|
@@ -5600,9 +5600,11 @@
|
|
|
5600
5600
|
const d5 = on(document, "click", () => {
|
|
5601
5601
|
if (isOpen) closePopup();
|
|
5602
5602
|
});
|
|
5603
|
-
this._disposers.push(d1, d2, d3, d4, d5)
|
|
5603
|
+
this._disposers.push(d1, d2, d3, d4, d5, () => {
|
|
5604
|
+
if (popup.parentNode) popup.parentNode.removeChild(popup);
|
|
5605
|
+
});
|
|
5604
5606
|
wrap.appendChild(btn);
|
|
5605
|
-
|
|
5607
|
+
document.body.appendChild(popup);
|
|
5606
5608
|
return wrap;
|
|
5607
5609
|
}
|
|
5608
5610
|
/**
|