Merge pull request #17039 from calixteman/alt_text_no_tooltip_when_resizing
[Editor] Disabled the alt-text button when the editor is being resized
This commit is contained in:
commit
fb16151247
@ -622,6 +622,8 @@ class AnnotationEditor {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.#toggleAltTextButton(false);
|
||||||
|
|
||||||
const boundResizerPointermove = this.#resizerPointermove.bind(this, name);
|
const boundResizerPointermove = this.#resizerPointermove.bind(this, name);
|
||||||
const savedDraggable = this._isDraggable;
|
const savedDraggable = this._isDraggable;
|
||||||
this._isDraggable = false;
|
this._isDraggable = false;
|
||||||
@ -641,6 +643,7 @@ class AnnotationEditor {
|
|||||||
window.getComputedStyle(event.target).cursor;
|
window.getComputedStyle(event.target).cursor;
|
||||||
|
|
||||||
const pointerUpCallback = () => {
|
const pointerUpCallback = () => {
|
||||||
|
this.#toggleAltTextButton(true);
|
||||||
this._isDraggable = savedDraggable;
|
this._isDraggable = savedDraggable;
|
||||||
window.removeEventListener("pointerup", pointerUpCallback);
|
window.removeEventListener("pointerup", pointerUpCallback);
|
||||||
window.removeEventListener("blur", pointerUpCallback);
|
window.removeEventListener("blur", pointerUpCallback);
|
||||||
@ -904,8 +907,10 @@ class AnnotationEditor {
|
|||||||
}, DELAY_TO_SHOW_TOOLTIP);
|
}, DELAY_TO_SHOW_TOOLTIP);
|
||||||
});
|
});
|
||||||
button.addEventListener("mouseleave", () => {
|
button.addEventListener("mouseleave", () => {
|
||||||
clearTimeout(this.#altTextTooltipTimeout);
|
if (this.#altTextTooltipTimeout) {
|
||||||
this.#altTextTooltipTimeout = null;
|
clearTimeout(this.#altTextTooltipTimeout);
|
||||||
|
this.#altTextTooltipTimeout = null;
|
||||||
|
}
|
||||||
this.#altTextTooltip?.classList.remove("show");
|
this.#altTextTooltip?.classList.remove("show");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -921,6 +926,17 @@ class AnnotationEditor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#toggleAltTextButton(enabled = false) {
|
||||||
|
if (!this.#altTextButton) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!enabled && this.#altTextTooltipTimeout) {
|
||||||
|
clearTimeout(this.#altTextTooltipTimeout);
|
||||||
|
this.#altTextTooltipTimeout = null;
|
||||||
|
}
|
||||||
|
this.#altTextButton.disabled = !enabled;
|
||||||
|
}
|
||||||
|
|
||||||
getClientDimensions() {
|
getClientDimensions() {
|
||||||
return this.div.getBoundingClientRect();
|
return this.div.getBoundingClientRect();
|
||||||
}
|
}
|
||||||
|
@ -481,6 +481,10 @@
|
|||||||
inset-block-end: 8px;
|
inset-block-end: 8px;
|
||||||
inset-inline-start: 8px;
|
inset-inline-start: 8px;
|
||||||
|
|
||||||
|
&:disabled {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
&:dir(ltr) {
|
&:dir(ltr) {
|
||||||
transform-origin: 0 100%;
|
transform-origin: 0 100%;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user