From 9b3c198629f44ecf01c15a4b59125a74368d4f98 Mon Sep 17 00:00:00 2001 From: guokeke Date: Fri, 30 Jun 2017 20:31:31 +0800 Subject: [PATCH] Add border option to danmaku param --- src/DPlayer.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/DPlayer.js b/src/DPlayer.js index 723f4a556..0466c0766 100644 --- a/src/DPlayer.js +++ b/src/DPlayer.js @@ -376,7 +376,7 @@ class DPlayer { this.danIndex = this.dan.length; } if (!this.paused) { - this.setTime('danmaku'); + this.setTime('danmaku'); } } } @@ -536,10 +536,10 @@ class DPlayer { const danmaku = { text: htmlEncode(danmakuData.text), color: danmakuData.color, - type: danmakuData.type + type: danmakuData.type, + border: `2px solid ${this.option.theme}` }; - const item = this.pushDanmaku(danmaku); - item.style.border = `2px solid ${this.option.theme}`; + this.pushDanmaku(danmaku); }; const closeCommentSetting = () => { @@ -1004,6 +1004,7 @@ class DPlayer { item.innerHTML = danmaku[i].text; item.style.opacity = this.danOpacity; item.style.color = danmaku[i].color; + item.style.border = danmaku[i].border; item.addEventListener('animationend', () => { danContainer.removeChild(item); });