소스 검색

Update Post and Profile components

Daniel Supernault 6 년 전
부모
커밋
6c2bf54bde
2개의 변경된 파일17개의 추가작업 그리고 0개의 파일을 삭제
  1. 10 0
      resources/assets/js/components/PostComponent.vue
  2. 7 0
      resources/assets/js/components/Profile.vue

+ 10 - 0
resources/assets/js/components/PostComponent.vue

@@ -490,6 +490,16 @@ export default {
           }
     },
 
+    beforeMount() {
+      let u = new URLSearchParams(window.location.search);
+      if(u.has('ui') && u.get('ui') == 'moment' && this.profileLayout != 'moment') {
+        this.profileLayout = 'moment';
+      }
+      if(u.has('ui') && u.get('ui') == 'metro' && this.profileLayout != 'metro') {
+        this.profileLayout = 'metro';
+      }
+    },
+
     mounted() {
       this.fetchRelationships();
     },

+ 7 - 0
resources/assets/js/components/Profile.vue

@@ -546,6 +546,13 @@ export default {
 			$('nav.navbar').hide();
 			$('body').prepend('<div class="bg-white p-3 border-bottom"><div class="d-flex justify-content-between align-items-center"><div onclick="window.history.back();"><i class="fas fa-chevron-left fa-lg"></i></div><div class="font-weight-bold">' + this.profileUsername + '</div><div><i class="fas fa-chevron-right text-white fa-lg"></i></div></div></div>');
 		}
+		let u = new URLSearchParams(window.location.search);
+		if(u.has('ui') && u.get('ui') == 'moment' && this.profileLayout != 'moment') {
+			this.profileLayout = 'moment';
+		}
+		if(u.has('ui') && u.get('ui') == 'metro' && this.profileLayout != 'metro') {
+			this.profileLayout = 'metro';
+		}
 	},
 
 	mounted() {