diff --git a/client/components/Reader/HelpPage/CommonHelpPage/CommonHelpPage.vue b/client/components/Reader/HelpPage/CommonHelpPage/CommonHelpPage.vue index 09d44bdb..812240d1 100644 --- a/client/components/Reader/HelpPage/CommonHelpPage/CommonHelpPage.vue +++ b/client/components/Reader/HelpPage/CommonHelpPage/CommonHelpPage.vue @@ -45,6 +45,7 @@ import Vue from 'vue'; import Component from 'vue-class-component'; import {copyTextToClipboard} from '../../../../share/utils'; +import * as notify from '../../../share/notify'; export default @Component({ }) @@ -60,9 +61,9 @@ class CommonHelpPage extends Vue { const result = await copyTextToClipboard(text); const msg = (result ? mes : 'Копирование не удалось'); if (result) - this.$notify.success({message: msg}); + notify.success(this, msg); else - this.$notify.error({message: msg}); + notify.error(this, msg); } } //----------------------------------------------------------------------------- diff --git a/client/components/share/notify.js b/client/components/share/notify.js new file mode 100644 index 00000000..56422f04 --- /dev/null +++ b/client/components/share/notify.js @@ -0,0 +1,35 @@ +export function success(vue, message, caption) { + caption = (caption ? `
${caption}

` : ''); + vue.$q.notify({ + position: 'top-right', + color: 'positive', + textColor: 'white', + icon: 'o_check_circle', + actions: [{icon: 'o_close', color: 'black'}], + html: true, + + message: + `
+ ${caption} +
${message}
+
` + }); +} + +export function error(vue, message, caption) { + caption = (caption ? `
${caption}

` : ''); + vue.$q.notify({ + position: 'top-right', + color: 'negative', + textColor: 'white', + icon: 'o_error_outline', + actions: [{icon: 'o_close', color: 'black'}], + html: true, + + message: + `
+ ${caption} +
${message}
+
` + }); +} \ No newline at end of file diff --git a/client/quasar.js b/client/quasar.js index 11e5bc31..003cd977 100644 --- a/client/quasar.js +++ b/client/quasar.js @@ -28,7 +28,7 @@ const components = { //QLayout, //QPageContainer, QPage, //QDrawer, - + QCircularProgress, QInput, QBtn, @@ -51,9 +51,11 @@ const directives = {Ripple}; //plugins import AppFullscreen from 'quasar/src/plugins/AppFullscreen'; +import Notify from 'quasar/src/plugins/Notify'; const plugins = { AppFullscreen, + Notify, }; //use