Browse Source

Minor syntax changes to Kris's commits

theflametrooper 8 years ago
parent
commit
b99185e05f
2 changed files with 7 additions and 11 deletions
  1. 5 9
      frontend/App.vue
  2. 2 2
      frontend/main.js

+ 5 - 9
frontend/App.vue

@@ -56,7 +56,7 @@
 				if (event.which == 13) b(); return false;
 			}
 		},
-		ready() {
+		readyL function () {
 			let _this = this;
 			auth.getStatus((authenticated, role, username, userId) => {
 				_this.socket = window.socket;
@@ -82,9 +82,7 @@
 								date.setTime(new Date().getTime() + (2 * 365 * 24 * 60 * 60 * 1000));
 								document.cookie = `SID=${result.SID}; expires=${date.toGMTString()}; path=/`;
 								location.reload();
-							} else {
-								_this.$router.go('/login');
-							}
+							} else _this.$router.go('/login');
 						}, 4000);
 					} else Toast.methods.addToast(result.message, 8000);
 				});
@@ -100,9 +98,7 @@
 						Toast.methods.addToast(`You have been successfully logged in`, 2000);
 						_this.$router.go('/');
 						location.reload();
-					} else {
-						Toast.methods.addToast(result.message, 2000);
-					}
+					} else Toast.methods.addToast(result.message, 2000);
 				});
 			},
 			'toggleModal': function (type) {
@@ -118,11 +114,11 @@
 						break;
 				}
 			},
-			'handleSocketConnection': function() {
+			'handleSocketConnection': function () {
 				this.socketConnected = window.socketConnected;
 				this.$broadcast('handleSocketConnection');
 			},
-			'closeModal': function() {
+			'closeModal': function () {
 				this.$broadcast('closeModal');
 			}
 		},

+ 2 - 2
frontend/main.js

@@ -36,9 +36,9 @@ lofig.get('serverDomain', function(res) {
 	}, 10000);
 });
 
-$(document).keydown(function(e) {
+$(document).keydown(e => {
 	if (e.which === 27) {
-		router.app.$dispatch("closeModal");
+		router.app.$dispatch('closeModal');
 	}
 });