Explorar o código

notice opacity

DIYgod %!s(int64=8) %!d(string=hai) anos
pai
achega
6bf1975bf2
Modificáronse 3 ficheiros con 3 adicións e 6 borrados
  1. 0 0
      dist/DPlayer.min.js
  2. 0 0
      dist/DPlayer.min.js.map
  3. 3 6
      src/DPlayer.js

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/DPlayer.min.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/DPlayer.min.js.map


+ 3 - 6
src/DPlayer.js

@@ -1112,19 +1112,16 @@ class DPlayer {
         };
     }
 
-    notice (text, time) {
+    notice (text, time = 2000, opacity = 0.8) {
         const noticeEle = this.element.getElementsByClassName('dplayer-notice')[0];
         noticeEle.innerHTML = text;
-        noticeEle.style.opacity = 1;
+        noticeEle.style.opacity = opacity;
         if (this.noticeTime) {
             clearTimeout(this.noticeTime);
         }
-        if (time && time < 0) {
-            return;
-        }
         this.noticeTime = setTimeout(() => {
             noticeEle.style.opacity = 0;
-        }, time || 2000);
+        }, time);
     }
 
     destroy () {

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio