()
| 2878 | } |
| 2879 | |
| 2880 | function selectedReportAnnotationRange() { |
| 2881 | const body = $("reportViewerBody"); |
| 2882 | const selection = window.getSelection(); |
| 2883 | if (body && selection && selection.rangeCount > 0 && !selection.isCollapsed) { |
| 2884 | const range = selection.getRangeAt(0); |
| 2885 | if (body.contains(range.commonAncestorContainer)) { |
| 2886 | return range.cloneRange(); |
| 2887 | } |
| 2888 | } |
| 2889 | const saved = state.reportAnnotationRange; |
| 2890 | if (body && saved && body.contains(saved.commonAncestorContainer)) { |
| 2891 | return saved.cloneRange(); |
| 2892 | } |
| 2893 | return null; |
| 2894 | } |
| 2895 | |
| 2896 | function applyReportAnnotation(command, value) { |
| 2897 | const body = $("reportViewerBody"); |
no test coverage detected