Переход на quasar
This commit is contained in:
@@ -257,6 +257,11 @@ body, html, #app {
|
|||||||
border: 2px solid yellow;
|
border: 2px solid yellow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-rotate {
|
||||||
|
vertical-align: middle;
|
||||||
|
animation: rotating 2s linear infinite;
|
||||||
|
}
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'ReaderDefault';
|
font-family: 'ReaderDefault';
|
||||||
src: url('fonts/reader-default.woff') format('woff'),
|
src: url('fonts/reader-default.woff') format('woff'),
|
||||||
|
|||||||
@@ -38,8 +38,9 @@ import Vue from 'vue';
|
|||||||
import Component from 'vue-class-component';
|
import Component from 'vue-class-component';
|
||||||
import {loadCSS} from 'fg-loadcss';
|
import {loadCSS} from 'fg-loadcss';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import {sleep} from '../../../share/utils';
|
|
||||||
|
|
||||||
|
import * as notify from '../../share/notify';
|
||||||
|
import {sleep} from '../../../share/utils';
|
||||||
import bookManager from '../share/bookManager';
|
import bookManager from '../share/bookManager';
|
||||||
import DrawHelper from './DrawHelper';
|
import DrawHelper from './DrawHelper';
|
||||||
import rstore from '../../../store/modules/reader';
|
import rstore from '../../../store/modules/reader';
|
||||||
@@ -281,16 +282,11 @@ class TextPage extends Vue {
|
|||||||
async loadFonts() {
|
async loadFonts() {
|
||||||
this.fontsLoading = true;
|
this.fontsLoading = true;
|
||||||
|
|
||||||
let inst = null;
|
let close = null;
|
||||||
(async() => {
|
(async() => {
|
||||||
await sleep(500);
|
await sleep(500);
|
||||||
if (this.fontsLoading)
|
if (this.fontsLoading)
|
||||||
inst = this.$notify({
|
close = notify.info(this, 'Загрузка шрифта <i class="material-icons-outlined icon-rotate" style="font-size: 150%">grade</i>');
|
||||||
title: '',
|
|
||||||
dangerouslyUseHTMLString: true,
|
|
||||||
message: 'Загрузка шрифта <i class="el-icon-loading"></i>',
|
|
||||||
duration: 0
|
|
||||||
});
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
if (!this.fontsLoaded)
|
if (!this.fontsLoaded)
|
||||||
@@ -305,15 +301,12 @@ class TextPage extends Vue {
|
|||||||
try {
|
try {
|
||||||
await this.checkLoadedFonts();
|
await this.checkLoadedFonts();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.$notify.error({
|
notify.error(this, 'Некоторые шрифты не удалось загрузить', 'Ошибка загрузки');
|
||||||
title: 'Ошибка загрузки',
|
|
||||||
message: 'Некоторые шрифты не удалось загрузить'
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.fontsLoading = false;
|
this.fontsLoading = false;
|
||||||
if (inst)
|
if (close)
|
||||||
inst.close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
getSettings() {
|
getSettings() {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
export function success(vue, message, caption) {
|
export function success(vue, message, caption) {
|
||||||
caption = (caption ? `<div style="font-size: 130%; color: black"><b>${caption}</b></div><br>` : '');
|
caption = (caption ? `<div style="font-size: 120%; color: black"><b>${caption}</b></div><br>` : '');
|
||||||
vue.$q.notify({
|
return vue.$q.notify({
|
||||||
position: 'top-right',
|
position: 'top-right',
|
||||||
color: 'positive',
|
color: 'positive',
|
||||||
textColor: 'white',
|
textColor: 'white',
|
||||||
@@ -17,8 +17,8 @@ export function success(vue, message, caption) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function error(vue, message, caption) {
|
export function error(vue, message, caption) {
|
||||||
caption = (caption ? `<div style="font-size: 130%; color: yellow"><b>${caption}</b></div><br>` : '');
|
caption = (caption ? `<div style="font-size: 120%; color: yellow"><b>${caption}</b></div><br>` : '');
|
||||||
vue.$q.notify({
|
return vue.$q.notify({
|
||||||
position: 'top-right',
|
position: 'top-right',
|
||||||
color: 'negative',
|
color: 'negative',
|
||||||
textColor: 'white',
|
textColor: 'white',
|
||||||
@@ -33,3 +33,21 @@ export function error(vue, message, caption) {
|
|||||||
</div>`
|
</div>`
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function info(vue, message, caption) {
|
||||||
|
caption = (caption ? `<div style="font-size: 120%; color: black"><b>${caption}</b></div><br>` : '');
|
||||||
|
return vue.$q.notify({
|
||||||
|
position: 'top-right',
|
||||||
|
color: 'info',
|
||||||
|
textColor: 'white',
|
||||||
|
icon: 'o_notifications',
|
||||||
|
actions: [{icon: 'o_close', color: 'black'}],
|
||||||
|
html: true,
|
||||||
|
|
||||||
|
message:
|
||||||
|
`<div style="max-width: 350px;">
|
||||||
|
${caption}
|
||||||
|
<div style="color: black; overflow-wrap: break-word; word-wrap: break-word;">${message}</div>
|
||||||
|
</div>`
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user