Переход на quasar
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="column no-wrap">
|
<div class="column no-wrap">
|
||||||
|
<StdDialog ref="stdDialog"/>
|
||||||
<div ref="header" class="header" v-show="toolBarActive">
|
<div ref="header" class="header" v-show="toolBarActive">
|
||||||
<div ref="buttons" class="row justify-between no-wrap">
|
<div ref="buttons" class="row justify-between no-wrap">
|
||||||
<button ref="loader" class="tool-button" :class="buttonActiveClass('loader')" @click="buttonClick('loader')" v-ripple>
|
<button ref="loader" class="tool-button" :class="buttonActiveClass('loader')" @click="buttonClick('loader')" v-ripple>
|
||||||
@@ -158,6 +159,7 @@ import Component from 'vue-class-component';
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import {Buffer} from 'safe-buffer';
|
import {Buffer} from 'safe-buffer';
|
||||||
|
|
||||||
|
import StdDialog from '../share/StdDialog.vue';
|
||||||
import LoaderPage from './LoaderPage/LoaderPage.vue';
|
import LoaderPage from './LoaderPage/LoaderPage.vue';
|
||||||
import TextPage from './TextPage/TextPage.vue';
|
import TextPage from './TextPage/TextPage.vue';
|
||||||
import ProgressPage from './ProgressPage/ProgressPage.vue';
|
import ProgressPage from './ProgressPage/ProgressPage.vue';
|
||||||
@@ -178,6 +180,7 @@ import {versionHistory} from './versionHistory';
|
|||||||
|
|
||||||
export default @Component({
|
export default @Component({
|
||||||
components: {
|
components: {
|
||||||
|
StdDialog,
|
||||||
LoaderPage,
|
LoaderPage,
|
||||||
TextPage,
|
TextPage,
|
||||||
ProgressPage,
|
ProgressPage,
|
||||||
@@ -297,6 +300,7 @@ class Reader extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.stdDialog = this.$refs.stdDialog;
|
||||||
this.updateHeaderMinWidth();
|
this.updateHeaderMinWidth();
|
||||||
|
|
||||||
(async() => {
|
(async() => {
|
||||||
@@ -1029,7 +1033,7 @@ class Reader extends Vue {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
progress.hide(); this.progressActive = false;
|
progress.hide(); this.progressActive = false;
|
||||||
this.loaderActive = true;
|
this.loaderActive = true;
|
||||||
this.$alert(e.message, 'Ошибка', {type: 'error'});
|
this.stdDialog.alert(e.message, 'Ошибка', {type: 'negative'});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1053,7 +1057,7 @@ class Reader extends Vue {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
progress.hide(); this.progressActive = false;
|
progress.hide(); this.progressActive = false;
|
||||||
this.loaderActive = true;
|
this.loaderActive = true;
|
||||||
this.$alert(e.message, 'Ошибка', {type: 'error'});
|
this.stdDialog.alert(e.message, 'Ошибка', {type: 'negative'});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1087,6 +1091,9 @@ class Reader extends Vue {
|
|||||||
|
|
||||||
keyHook(event) {
|
keyHook(event) {
|
||||||
if (this.$root.rootRoute() == '/reader') {
|
if (this.$root.rootRoute() == '/reader') {
|
||||||
|
if (this.stdDialog.active)
|
||||||
|
return;
|
||||||
|
|
||||||
let handled = false;
|
let handled = false;
|
||||||
if (!handled && this.helpActive)
|
if (!handled && this.helpActive)
|
||||||
handled = this.$refs.helpPage.keyHook(event);
|
handled = this.$refs.helpPage.keyHook(event);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<div v-show="type == 'alert'" class="column bg-white">
|
<div v-show="type == 'alert'" class="column bg-white">
|
||||||
<div class="header row">
|
<div class="header row">
|
||||||
<div class="caption col row items-center q-ml-md">
|
<div class="caption col row items-center q-ml-md">
|
||||||
<q-icon v-show="caption" class="text-warning q-mr-sm" name="las la-exclamation-circle" size="28px"></q-icon>
|
<q-icon v-show="caption" class="q-mr-sm" :class="iconColor" name="las la-exclamation-circle" size="28px"></q-icon>
|
||||||
<div v-html="caption"></div>
|
<div v-html="caption"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="close-icon column justify-center items-center">
|
<div class="close-icon column justify-center items-center">
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
<div v-show="type == 'confirm'" class="column bg-white">
|
<div v-show="type == 'confirm'" class="column bg-white">
|
||||||
<div class="header row">
|
<div class="header row">
|
||||||
<div class="caption col row items-center q-ml-md">
|
<div class="caption col row items-center q-ml-md">
|
||||||
<q-icon v-show="caption" class="text-warning q-mr-sm" name="las la-exclamation-circle" size="28px"></q-icon>
|
<q-icon v-show="caption" class="q-mr-sm" :class="iconColor" name="las la-exclamation-circle" size="28px"></q-icon>
|
||||||
<div v-html="caption"></div>
|
<div v-html="caption"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="close-icon column justify-center items-center">
|
<div class="close-icon column justify-center items-center">
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
<div v-show="type == 'prompt'" class="column bg-white">
|
<div v-show="type == 'prompt'" class="column bg-white">
|
||||||
<div class="header row">
|
<div class="header row">
|
||||||
<div class="caption col row items-center q-ml-md">
|
<div class="caption col row items-center q-ml-md">
|
||||||
<q-icon v-show="caption" class="text-warning q-mr-sm" name="las la-exclamation-circle" size="28px"></q-icon>
|
<q-icon v-show="caption" class="q-mr-sm" :class="iconColor" name="las la-exclamation-circle" size="28px"></q-icon>
|
||||||
<div v-html="caption"></div>
|
<div v-html="caption"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="close-icon column justify-center items-center">
|
<div class="close-icon column justify-center items-center">
|
||||||
@@ -98,6 +98,7 @@ class StdDialog extends Vue {
|
|||||||
type = '';
|
type = '';
|
||||||
inputValue = '';
|
inputValue = '';
|
||||||
error = '';
|
error = '';
|
||||||
|
iconColor = '';
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
if (this.$root.addKeyHook) {
|
if (this.$root.addKeyHook) {
|
||||||
@@ -105,7 +106,7 @@ class StdDialog extends Vue {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
init(message, caption) {
|
init(message, caption, opts) {
|
||||||
this.caption = caption;
|
this.caption = caption;
|
||||||
this.message = message;
|
this.message = message;
|
||||||
|
|
||||||
@@ -114,6 +115,11 @@ class StdDialog extends Vue {
|
|||||||
this.inputValidator = null;
|
this.inputValidator = null;
|
||||||
this.inputValue = '';
|
this.inputValue = '';
|
||||||
this.error = '';
|
this.error = '';
|
||||||
|
|
||||||
|
this.iconColor = 'text-warning';
|
||||||
|
if (opts && opts.type) {
|
||||||
|
this.iconColor = `text-${opts.type}`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onHide() {
|
onHide() {
|
||||||
@@ -156,9 +162,9 @@ class StdDialog extends Vue {
|
|||||||
this.$refs.dialog.hide();
|
this.$refs.dialog.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
alert(message, caption) {
|
alert(message, caption, opts) {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
this.init(message, caption);
|
this.init(message, caption, opts);
|
||||||
|
|
||||||
this.hideTrigger = () => {
|
this.hideTrigger = () => {
|
||||||
if (this.ok) {
|
if (this.ok) {
|
||||||
@@ -173,9 +179,9 @@ class StdDialog extends Vue {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
confirm(message, caption) {
|
confirm(message, caption, opts) {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
this.init(message, caption);
|
this.init(message, caption, opts);
|
||||||
|
|
||||||
this.hideTrigger = () => {
|
this.hideTrigger = () => {
|
||||||
if (this.ok) {
|
if (this.ok) {
|
||||||
@@ -193,7 +199,7 @@ class StdDialog extends Vue {
|
|||||||
prompt(message, caption, opts) {
|
prompt(message, caption, opts) {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
this.enableValidator = false;
|
this.enableValidator = false;
|
||||||
this.init(message, caption);
|
this.init(message, caption, opts);
|
||||||
|
|
||||||
this.hideTrigger = () => {
|
this.hideTrigger = () => {
|
||||||
if (this.ok) {
|
if (this.ok) {
|
||||||
|
|||||||
Reference in New Issue
Block a user