From 109d8aca9fec3ce0f8375d194010458a3bf8d8a8 Mon Sep 17 00:00:00 2001 From: winkidney Date: Sat, 7 Dec 2019 18:08:26 +0800 Subject: [PATCH] Feature: Add2Board works well --- .../src/components/editors/PinEditorUI.vue | 6 +- pinry-spa/src/components/modals.js | 13 +++ .../src/components/pin_edit/Add2Board.vue | 106 ++++++++++++++++++ 3 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 pinry-spa/src/components/pin_edit/Add2Board.vue diff --git a/pinry-spa/src/components/editors/PinEditorUI.vue b/pinry-spa/src/components/editors/PinEditorUI.vue index 05c1544..605e609 100644 --- a/pinry-spa/src/components/editors/PinEditorUI.vue +++ b/pinry-spa/src/components/editors/PinEditorUI.vue @@ -8,7 +8,7 @@ custom-size="mdi-24px"> - + import API from '../api'; +import modals from '../modals'; export default { name: 'Editor', @@ -68,6 +69,9 @@ export default { }, }, methods: { + addToBoar() { + modals.openAdd2Board(this, this.pin, this.currentUsername); + }, removeFromBoard() { this.$buefy.dialog.confirm({ message: 'Remove Pin from Board?', diff --git a/pinry-spa/src/components/modals.js b/pinry-spa/src/components/modals.js index 96b6a22..e76ccbb 100644 --- a/pinry-spa/src/components/modals.js +++ b/pinry-spa/src/components/modals.js @@ -2,6 +2,7 @@ import PinCreateModal from './pin_edit/PinCreateModal.vue'; import LoginForm from './LoginForm.vue'; import SignUpForm from './SignUpForm.vue'; import BoardEdit from './BoardEdit.vue'; +import Add2Board from './pin_edit/Add2Board.vue'; function openPinCreate(vm, onCreate, props = null) { @@ -18,6 +19,17 @@ function openPinCreate(vm, onCreate, props = null) { ); } +function openAdd2Board(vm, pin, username) { + vm.$buefy.modal.open( + { + parent: vm, + component: Add2Board, + props: { pin, username }, + hasModalCard: true, + }, + ); +} + function openBoardCreate(vm) { vm.$buefy.modal.open( { @@ -70,6 +82,7 @@ function openSignUp(vm, onSignUpSucceed) { export default { openBoardCreate, openBoardEdit, + openAdd2Board, openPinCreate, openLogin, openSignUp, diff --git a/pinry-spa/src/components/pin_edit/Add2Board.vue b/pinry-spa/src/components/pin_edit/Add2Board.vue new file mode 100644 index 0000000..a91e120 --- /dev/null +++ b/pinry-spa/src/components/pin_edit/Add2Board.vue @@ -0,0 +1,106 @@ + + +