소스 검색

Исправил сообщение о загрузке шрифтов

Book Pauk 6 년 전
부모
커밋
cc3aa413e8
2개의 변경된 파일19개의 추가작업 그리고 18개의 파일을 삭제
  1. 18 17
      client/components/Reader/TextPage/TextPage.vue
  2. 1 1
      client/components/Reader/versionHistory.js

+ 18 - 17
client/components/Reader/TextPage/TextPage.vue

@@ -23,7 +23,6 @@
             oncontextmenu="return false;">
             <div v-show="showStatusBar" v-html="statusBarClickable" @mousedown.prevent.stop @touchstart.stop
                 @click.prevent.stop="onStatusBarClick"></div>
-            <div v-show="fontsLoading" ref="fontsLoading"></div>
         </div>
         <div v-show="!clickControl && showStatusBar" class="layout" v-html="statusBarClickable" @mousedown.prevent.stop @touchstart.stop
             @click.prevent.stop="onStatusBarClick"></div>
@@ -77,7 +76,6 @@ class TextPage extends Vue {
     page2 = null;
     statusBar = null;
     statusBarClickable = null;
-    fontsLoading = null;
 
     lastBook = null;
     bookPos = 0;
@@ -203,21 +201,6 @@ class TextPage extends Vue {
         this.drawHelper.lineHeight = this.lineHeight;
         this.drawHelper.context = this.context;
 
-        //сообщение "Загрузка шрифтов..."
-        this.$refs.fontsLoading.innerHTML = '';
-        (async() => {
-            await sleep(500);
-            const flText = 'Загрузка шрифта';
-            this.$refs.fontsLoading.innerHTML = flText + ' &nbsp;<i class="el-icon-loading"></i>';
-            const fontsLoadingStyle = this.$refs.fontsLoading.style;
-            fontsLoadingStyle.position = 'absolute';
-            fontsLoadingStyle.fontSize = this.fontSize + 'px';
-            fontsLoadingStyle.top = (this.realHeight/2 - 2*this.fontSize) + 'px';
-            fontsLoadingStyle.left = (this.realWidth - this.drawHelper.measureText(flText, {}))/2 + 'px';
-            await sleep(10500);
-            this.$refs.fontsLoading.innerHTML = '';
-        })();
-
         //parsed
         if (this.parsed) {
             this.parsed.p = this.p;
@@ -274,6 +257,18 @@ class TextPage extends Vue {
     async loadFonts() {
         this.fontsLoading = true;
 
+        let inst = null;
+        (async() => {
+            await sleep(500);
+            if (this.fontsLoading)
+                inst = this.$notify({
+                  title: '',
+                  dangerouslyUseHTMLString: true,
+                  message: 'Загрузка шрифта &nbsp;<i class="el-icon-loading"></i>',
+                  duration: 0
+                });
+        })();
+
         if (!this.fontsLoaded)
             this.fontsLoaded = {};
         //загрузка дин.шрифта
@@ -304,6 +299,8 @@ class TextPage extends Vue {
         }
 
         this.fontsLoading = false;
+        if (inst)
+            inst.close();
     }
 
     getSettings() {
@@ -1126,6 +1123,10 @@ class TextPage extends Vue {
     overflow: hidden;
 }
 
+.on-top {
+    z-index: 100;
+}
+
 .back {
     z-index: 5;
 }

+ 1 - 1
client/components/Reader/versionHistory.js

@@ -7,7 +7,7 @@ export const versionHistory = [
 <ul>
     <li>исправлен баг - падение сервера при распаковке битых архивов книг</li>
     <li>исправлен баг - не распознавались некоторые книги формата fb2 в кодировке utf8</li>
-    <li>незначительные улучшения прогрессбаров</li>
+    <li>улучшены прогрессбары</li>
 </ul>
 `
 },