浏览代码

Merge pull request #1226 from pixelfed/frontend-ui-refactor

Frontend ui refactor
daniel 6 年之前
父节点
当前提交
4b05aa8946

+ 0 - 9
app/Http/Controllers/Api/BaseApiController.php

@@ -44,15 +44,6 @@ class BaseApiController extends Controller
         $this->fractal->setSerializer(new ArraySerializer());
     }
 
-    public function notification(Request $request, $id)
-    {
-        $notification = Notification::findOrFail($id);
-        $resource = new Fractal\Resource\Item($notification, new NotificationTransformer());
-        $res = $this->fractal->createData($resource)->toArray();
-
-        return response()->json($res);
-    }
-
     public function notifications(Request $request)
     {
         $pid = Auth::user()->profile->id;

二进制
public/js/timeline.js


二进制
public/mix-manifest.json


+ 3 - 1
resources/assets/js/components/NotificationCard.vue

@@ -70,7 +70,9 @@
 		},
 
 		mounted() {
-			this.fetchNotifications();
+			if(window.outerWidth > 767) {
+				this.fetchNotifications();
+			}
 		},
 
 		updated() {

+ 6 - 2
resources/assets/js/components/Timeline.vue

@@ -397,7 +397,9 @@
 			.then(res => {
 				this.config = res.data;
 				this.fetchTimelineApi();
-				this.fetchProfile();
+				if(window.outerWidth > 767) {
+					this.fetchProfile();
+				}
 			});
 		},
 
@@ -459,7 +461,9 @@
 					this.max_id = Math.min(...ids);
 					$('.timeline .pagination').removeClass('d-none');
 					this.loading = false;
-					this.expRec();
+					if(window.outerWidth > 767) {
+						this.expRec();
+					}
 				}).catch(err => {
 				});
 			},