From 198dd6e4ad2f92acd77668016bc689ec8f5b46cd Mon Sep 17 00:00:00 2001 From: Shyim Date: Thu, 26 Apr 2018 17:09:05 +0200 Subject: [PATCH] Use vue shorthand for events, bind save on form instead button --- .../components/Dashboard/Layout/TopNavbar.vue | 2 +- .../ReCast/Endpoints/EditEndpoint.vue | 51 ++++++++++--------- public/theme/src/components/ReCast/Login.vue | 32 +++++++----- .../components/ReCast/Streams/EditStream.vue | 19 ++++--- .../src/components/ReCast/Streams/List.vue | 9 +--- 5 files changed, 59 insertions(+), 54 deletions(-) diff --git a/public/theme/src/components/Dashboard/Layout/TopNavbar.vue b/public/theme/src/components/Dashboard/Layout/TopNavbar.vue index dcd180c..b9f9774 100644 --- a/public/theme/src/components/Dashboard/Layout/TopNavbar.vue +++ b/public/theme/src/components/Dashboard/Layout/TopNavbar.vue @@ -19,7 +19,7 @@ Account Settings - + Log out diff --git a/public/theme/src/components/ReCast/Endpoints/EditEndpoint.vue b/public/theme/src/components/ReCast/Endpoints/EditEndpoint.vue index 6a95fdc..2a68396 100644 --- a/public/theme/src/components/ReCast/Endpoints/EditEndpoint.vue +++ b/public/theme/src/components/ReCast/Endpoints/EditEndpoint.vue @@ -7,35 +7,37 @@

Edit "{{ endpoint.name }}"

- +
+ -
- Active -
+
+ Active +
-
- - -
+
+ + +
-
- - -
+
+ + +
- + - + - + +
@@ -77,7 +79,8 @@ } }, methods: { - save: function () { + save: function (e) { + e.preventDefault(); this.axios.post('/streams/' + this.$route.params.streamId + '/endpoints/update', this.endpoint).then(() => { this.$router.push('/ucp/streams/' + this.$route.params.streamId + '/'); }).catch(error => { diff --git a/public/theme/src/components/ReCast/Login.vue b/public/theme/src/components/ReCast/Login.vue index d9d34c2..df09bca 100644 --- a/public/theme/src/components/ReCast/Login.vue +++ b/public/theme/src/components/ReCast/Login.vue @@ -6,22 +6,25 @@
Bad credentials
- - -
- - -
+
+ + -
- Remember Me -
+
+ + +
- +
+ Remember Me +
+ + +
@@ -45,7 +48,8 @@ } }, methods: { - onLogin: function () { + onLogin: function (e) { + e.preventDefault(); let bodyFormData = new FormData(); bodyFormData.set('_username', this.login._username); bodyFormData.set('_password', this.login._password); diff --git a/public/theme/src/components/ReCast/Streams/EditStream.vue b/public/theme/src/components/ReCast/Streams/EditStream.vue index 0d7c43c..036b9b9 100644 --- a/public/theme/src/components/ReCast/Streams/EditStream.vue +++ b/public/theme/src/components/ReCast/Streams/EditStream.vue @@ -7,12 +7,14 @@

Edit "{{ stream.name }}"

- -
- Active -
+
+ +
+ Active +
- + +
@@ -39,8 +41,8 @@ {{ endpoint.server }} Edit - {{ endpoint.active ? 'Disable' : 'Enable' }} - Delete + {{ endpoint.active ? 'Disable' : 'Enable' }} + Delete @@ -81,7 +83,8 @@ } }, methods: { - save: function () { + save: function (e) { + e.preventDefault(); this.axios.post('/streams/update', this.stream).then(() => { this.$router.push('/ucp/streams/'); }).catch(error => { diff --git a/public/theme/src/components/ReCast/Streams/List.vue b/public/theme/src/components/ReCast/Streams/List.vue index 2824b78..fa8a8c4 100644 --- a/public/theme/src/components/ReCast/Streams/List.vue +++ b/public/theme/src/components/ReCast/Streams/List.vue @@ -25,8 +25,8 @@ Setup Edit - Regenerate Stream Key - Delete + Regenerate Stream Key + Delete @@ -38,7 +38,6 @@