From a41e19a6539836cbe395e3f06f16c7c08e9f1639 Mon Sep 17 00:00:00 2001 From: shpuld Date: Sat, 2 Mar 2019 17:13:35 +0200 Subject: [PATCH] Rename component, remove stupid console logs, make text box focus automatically --- src/App.js | 4 ++-- src/App.vue | 2 +- .../mobile_post_status_modal.js} | 11 +++++++---- .../mobile_post_status_modal.vue} | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) rename src/components/{new_status_button/new_status_button.js => mobile_post_status_modal/mobile_post_status_modal.js} (88%) rename src/components/{new_status_button/new_status_button.vue => mobile_post_status_modal/mobile_post_status_modal.vue} (96%) diff --git a/src/App.js b/src/App.js index 0f3d0f2e..5c27a3df 100644 --- a/src/App.js +++ b/src/App.js @@ -8,7 +8,7 @@ import WhoToFollowPanel from './components/who_to_follow_panel/who_to_follow_pan import ChatPanel from './components/chat_panel/chat_panel.vue' import MediaModal from './components/media_modal/media_modal.vue' import SideDrawer from './components/side_drawer/side_drawer.vue' -import NewStatusButton from './components/new_status_button/new_status_button.vue' +import MobilePostStatusModal from './components/mobile_post_status_modal/mobile_post_status_modal.vue' import { unseenNotificationsFromStore } from './services/notification_utils/notification_utils' export default { @@ -24,7 +24,7 @@ export default { ChatPanel, MediaModal, SideDrawer, - NewStatusButton + MobilePostStatusModal }, data: () => ({ mobileActivePanel: 'timeline', diff --git a/src/App.vue b/src/App.vue index 8955ed08..4fff3d1d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -50,7 +50,7 @@ - + diff --git a/src/components/new_status_button/new_status_button.js b/src/components/mobile_post_status_modal/mobile_post_status_modal.js similarity index 88% rename from src/components/new_status_button/new_status_button.js rename to src/components/mobile_post_status_modal/mobile_post_status_modal.js index 8c91d18b..92314880 100644 --- a/src/components/new_status_button/new_status_button.js +++ b/src/components/mobile_post_status_modal/mobile_post_status_modal.js @@ -1,7 +1,7 @@ import PostStatusForm from '../post_status_form/post_status_form.vue' import { throttle } from 'lodash' -const NewStatusButton = { +const MobilePostStatusModal = { components: { PostStatusForm }, @@ -15,7 +15,6 @@ const NewStatusButton = { } }, created () { - console.log('new-status-button') window.addEventListener('scroll', this.handleScroll) }, destroyed () { @@ -23,7 +22,6 @@ const NewStatusButton = { }, computed: { currentUser () { - console.log(this.$store.state.users.currentUser) return this.$store.state.users.currentUser } }, @@ -31,6 +29,11 @@ const NewStatusButton = { openPostForm () { this.postFormOpen = true this.shown = false + + const el = this.$el.querySelector('textarea') + this.$nextTick(function () { + el.focus() + }) }, closePostForm () { this.postFormOpen = false @@ -59,4 +62,4 @@ const NewStatusButton = { } } -export default NewStatusButton +export default MobilePostStatusModal diff --git a/src/components/new_status_button/new_status_button.vue b/src/components/mobile_post_status_modal/mobile_post_status_modal.vue similarity index 96% rename from src/components/new_status_button/new_status_button.vue rename to src/components/mobile_post_status_modal/mobile_post_status_modal.vue index 8ebc8583..ffac7c99 100644 --- a/src/components/new_status_button/new_status_button.vue +++ b/src/components/mobile_post_status_modal/mobile_post_status_modal.vue @@ -20,7 +20,7 @@ - +