|
|
@@ -773,7 +773,6 @@ export default {
|
|
|
// 处理选中文本
|
|
|
handleTextSelection() {
|
|
|
this.showToolbar = false;
|
|
|
- // 延迟处理,确保选择已完成
|
|
|
setTimeout(() => {
|
|
|
const selection = window.getSelection();
|
|
|
if (selection.toString().trim() === '') return null;
|
|
|
@@ -789,12 +788,11 @@ export default {
|
|
|
this.selectHandleInfo = selectHandleInfo;
|
|
|
|
|
|
if (!this.canRemark) this.showToolbar = true;
|
|
|
- const container = document.querySelector('.courseware');
|
|
|
- const boxRect = container.getBoundingClientRect();
|
|
|
const selectRect = range.getBoundingClientRect();
|
|
|
this.contentmenu = {
|
|
|
- left: `${Math.round(selectRect.left - boxRect.left + selectRect.width / 2 - 63)}px`,
|
|
|
- top: `${Math.round(selectRect.top - boxRect.top + selectRect.height)}px`, // 向上偏移10px
|
|
|
+ position: 'fixed',
|
|
|
+ left: `${Math.round(selectRect.left + selectRect.width / 2 - 63)}px`,
|
|
|
+ top: `${Math.round(selectRect.bottom + 5)}px`,
|
|
|
};
|
|
|
}, 100);
|
|
|
if (this.canRemark) {
|
|
|
@@ -1216,7 +1214,6 @@ export default {
|
|
|
}
|
|
|
|
|
|
.contentmenu {
|
|
|
- position: absolute;
|
|
|
z-index: 999;
|
|
|
display: flex;
|
|
|
column-gap: 4px;
|