MediaWiki:Gadget-GrAnnotations.js: Difference between revisions
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
/** | /** | ||
* gr_annotations.js — grantha.io inline Notes + Bookmarks + Feedback (v5 | * gr_annotations.js — grantha.io inline Notes + Bookmarks + Feedback (v5-patch1) | ||
* ═════════════════════════════════════════════════════════════════════ | |||
* | |||
*/ | */ | ||
| Line 276: | Line 255: | ||
if (ancestor.nodeType === 3) ancestor = ancestor.parentNode; | if (ancestor.nodeType === 3) ancestor = ancestor.parentNode; | ||
if (!ancestor || !contentEl.contains(ancestor)) return false; | if (!ancestor || !contentEl.contains(ancestor)) return false; | ||
/* ── Editor mode guard (v5-patch1) ──────────────────────────── | |||
* Do not fire the annotation gadget when the selection is inside | |||
* the custom editor surface (#se-surface / .se-outer). | |||
* This is a purely additive check — no existing logic is changed. | |||
* ──────────────────────────────────────────────────────────── */ | |||
var _editorEl = document.getElementById('se-surface') || | |||
document.querySelector('.se-outer'); | |||
if ( _editorEl && _editorEl.contains(ancestor) ) return false; | |||
_selText = text; | _selText = text; | ||