From ba1c823fb1839790ffc0bf3881ed8aead5d40713 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 9 Oct 2018 14:58:37 +0900 Subject: [PATCH] :art: --- package.json | 1 + src/client/app/app.styl | 13 +++++++++++++ .../app/common/views/components/note-menu.vue | 6 ++++++ src/client/app/init.ts | 2 ++ 4 files changed, 22 insertions(+) diff --git a/package.json b/package.json index 377f99787..97bf8f917 100644 --- a/package.json +++ b/package.json @@ -219,6 +219,7 @@ "vue-router": "3.0.1", "vue-style-loader": "4.1.2", "vue-svg-inline-loader": "1.2.0", + "vue-sweetalert2": "1.5.5", "vue-template-compiler": "2.5.17", "vuedraggable": "2.16.0", "vuewordcloud": "18.7.11", diff --git a/src/client/app/app.styl b/src/client/app/app.styl index 2f0095944..574ec306e 100644 --- a/src/client/app/app.styl +++ b/src/client/app/app.styl @@ -130,3 +130,16 @@ pre [data-fa] display inline-block + +.swal2-popup + background var(--face) !important + +.swal-icon-only + width 180px !important + + > .swal2-header + > .swal2-icon + margin 1.25em auto 1.875em + + > .swal2-title + display none diff --git a/src/client/app/common/views/components/note-menu.vue b/src/client/app/common/views/components/note-menu.vue index c8ed1225c..fd66cba8c 100644 --- a/src/client/app/common/views/components/note-menu.vue +++ b/src/client/app/common/views/components/note-menu.vue @@ -103,6 +103,12 @@ export default Vue.extend({ (this as any).api('notes/favorites/create', { noteId: this.note.id }).then(() => { + this.$swal({ + type: 'success', + showConfirmButton: false, + timer: 1250, + customClass: 'swal-icon-only' + }); this.destroyDom(); }); }, diff --git a/src/client/app/init.ts b/src/client/app/init.ts index c2381067d..ad9909374 100644 --- a/src/client/app/init.ts +++ b/src/client/app/init.ts @@ -8,6 +8,7 @@ import VueRouter from 'vue-router'; import * as TreeView from 'vue-json-tree-view'; import VAnimateCss from 'v-animate-css'; import VModal from 'vue-js-modal'; +import VueSweetalert2 from 'vue-sweetalert2'; import VueHotkey from './common/hotkey'; import App from './app.vue'; @@ -26,6 +27,7 @@ Vue.use(TreeView); Vue.use(VAnimateCss); Vue.use(VModal); Vue.use(VueHotkey); +Vue.use(VueSweetalert2); // Register global directives require('./common/views/directives');