dsh-whale-widget 0.2.7 → 0.2.8
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/lib/index.js +6 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -385,10 +385,13 @@ bubbleBox.addEventListener('click', function (e) {
|
|
|
385
385
|
// 再次点击:关闭
|
|
386
386
|
hideBubble()
|
|
387
387
|
} else {
|
|
388
|
-
//
|
|
388
|
+
// 首次点击:切到随机台词段,并重置自动关闭计时——
|
|
389
|
+
// 保证第二段台词有完整停留时间(否则第 4 秒点击只看到 0.5 秒)
|
|
389
390
|
bubbleRandomActive = true
|
|
390
391
|
bubbleRandomLines = pickRandomLines()
|
|
391
392
|
swapBubbleContent(function () { applyBubbleLines(bubbleRandomLines) })
|
|
393
|
+
if (bubbleTimer) { clearTimeout(bubbleTimer); bubbleTimer = null }
|
|
394
|
+
bubbleTimer = setTimeout(hideBubble, BUBBLE_MS)
|
|
392
395
|
}
|
|
393
396
|
})
|
|
394
397
|
|
|
@@ -1238,6 +1241,8 @@ function endDrag(e, clickAllowed) {
|
|
|
1238
1241
|
state.left = left
|
|
1239
1242
|
state.top = top
|
|
1240
1243
|
settle()
|
|
1244
|
+
// 拖拽结束立即保存锚点位置(否则刷新/关闭后位置回退到上次改菜单时)
|
|
1245
|
+
saveConfig()
|
|
1241
1246
|
}
|
|
1242
1247
|
// 窗口尺寸变化时:自由位置的鲸鱼按相对边框锚点重算(保持离边距离,窗口恢复原状即回原位);
|
|
1243
1248
|
// 贴边吸附的鲸鱼走 settle()(保持贴边)
|