소스 검색

Update ContextMenu, add View Profile link

Daniel Supernault 4 년 전
부모
커밋
8544bcbda6
1개의 변경된 파일16개의 추가작업 그리고 0개의 파일을 삭제
  1. 16 0
      resources/assets/js/components/partials/ContextMenu.vue

+ 16 - 0
resources/assets/js/components/partials/ContextMenu.vue

@@ -12,6 +12,7 @@
 				<!-- <div v-if="status && status.account.id != profile.id && ctxMenuRelationship && ctxMenuRelationship.following" class="list-group-item rounded cursor-pointer font-weight-bold text-danger" @click="ctxMenuUnfollow()">Unfollow</div>
 				<div v-if="status && status.account.id != profile.id && ctxMenuRelationship && !ctxMenuRelationship.following" class="list-group-item rounded cursor-pointer font-weight-bold text-primary" @click="ctxMenuFollow()">Follow</div> -->
 				<div class="list-group-item rounded cursor-pointer" @click="ctxMenuGoToPost()">View Post</div>
+				<div class="list-group-item rounded cursor-pointer" @click="ctxMenuGoToProfile()">View Profile</div>
 				<!-- <div v-if="status && status.local == true && !status.in_reply_to_id" class="list-group-item rounded cursor-pointer" @click="ctxMenuEmbed()">Embed</div>
 				<div class="list-group-item rounded cursor-pointer" @click="ctxMenuCopyLink()">Copy Link</div> -->
 				<div class="list-group-item rounded cursor-pointer" @click="ctxMenuShare()">Share</div>
@@ -279,6 +280,13 @@
 				return;
 			},
 
+			ctxMenuGoToProfile() {
+				let status = this.ctxMenuStatus;
+				window.location.href = this.profileUrl(status);
+				this.closeCtxMenu();
+				return;
+			},
+
 			ctxMenuFollow() {
 				let id = this.ctxMenuStatus.account.id;
 				axios.post('/i/follow', {
@@ -633,6 +641,14 @@
 				return '/i/web/post/_/' + status.account.id + '/' + status.id;
 			},
 
+			profileUrl(status) {
+				if(status.local == true) {
+					return status.account.url;
+				}
+
+				return '/i/web/profile/_/' + status.account.id;
+			},
+
 			deletePost(status) {
 				if($('body').hasClass('loggedIn') == false || this.ownerOrAdmin(status) == false) {
 					return;