]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Hide description previews on mobile view
authorChocobozzz <me@florianbigard.com>
Wed, 31 Jan 2018 09:42:01 +0000 (10:42 +0100)
committerChocobozzz <me@florianbigard.com>
Wed, 31 Jan 2018 09:42:01 +0000 (10:42 +0100)
client/src/app/+admin/jobs/shared/job.service.ts
client/src/app/account/account-settings/account-settings.component.scss
client/src/app/app.component.ts
client/src/app/videos/+video-edit/shared/video-description.component.html
client/src/app/videos/+video-edit/shared/video-description.component.ts
client/src/sass/application.scss
client/src/sass/include/_mixins.scss

index a19d278c908c183638ad4372aec8ba1090a7ac3d..1c0915b5ec6b21a3310b6eb45e7c61530df78acb 100644 (file)
@@ -25,7 +25,7 @@ export class JobService {
     params = this.restService.addRestGetParams(params, pagination, sort)
 
     return this.authHttp.get<ResultList<Job>>(JobService.BASE_JOB_URL + '/' + state, { params })
-      .map(res => this.restExtractor.convertResultListDateToHuman(res))
+      .map(res => this.restExtractor.convertResultListDateToHuman(res, [ 'createdAt', 'updatedAt' ]))
       .map(res => this.restExtractor.applyToResultListData(res, this.prettyPrintData))
       .catch(err => this.restExtractor.handleError(err))
   }
index aaf9d79f0b3a53224a7c560f84bde361f081bc69..1cc00ca498d7ad6e59521068482dd598f79f56b4 100644 (file)
@@ -26,6 +26,7 @@
   @include peertube-button-file(160px);
 
   margin-top: 10px;
+  margin-bottom: 5px;
 }
 
 .file-max-size {
index 58464029063840869ec25e0d4a9a5b3e526f2f6a..d2678096f7887b6bed4e0c621095f39ba4f4354c 100644 (file)
@@ -1,6 +1,7 @@
 import { Component, OnInit } from '@angular/core'
 import { NavigationEnd, Router } from '@angular/router'
 import { AuthService, ServerService } from '@app/core'
+import { isInMobileView } from '@app/shared/misc/utils'
 
 @Component({
   selector: 'my-app',
@@ -49,14 +50,14 @@ export class AppComponent implements OnInit {
     this.serverService.loadVideoPrivacies()
 
     // Do not display menu on small screens
-    if (window.innerWidth < 600) {
+    if (isInMobileView()) {
       this.isMenuDisplayed = false
     }
 
     this.router.events.subscribe(
       e => {
         // User clicked on a link in the menu, change the page
-        if (e instanceof NavigationEnd && window.innerWidth < 600) {
+        if (e instanceof NavigationEnd && isInMobileView()) {
           this.isMenuDisplayed = false
         }
       }
index 5d05467be29ae37d17ae5c51a96ad7453cf3fc87..989292c47630a9fead5a9ab7d21f8ef7cb2ff3cf 100644 (file)
@@ -3,7 +3,7 @@
   id="description" name="description">
 </textarea>
 
-<tabset #staticTabs class="previews">
+<tabset *ngIf="arePreviewsDisplayed()" #staticTabs class="previews">
   <tab heading="Truncated description preview" [innerHTML]="truncatedDescriptionHTML"></tab>
   <tab heading="Complete description preview" [innerHTML]="descriptionHTML"></tab>
 </tabset>
index 34dbc21a6af662c8907f304c7391426c81016434..eba345412112e17711aaedb7f89664550dcb1599 100644 (file)
@@ -2,6 +2,7 @@ import { Component, forwardRef, Input, OnInit } from '@angular/core'
 import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'
 import 'rxjs/add/operator/debounceTime'
 import 'rxjs/add/operator/distinctUntilChanged'
+import { isInMobileView } from '@app/shared/misc/utils'
 import { Subject } from 'rxjs/Subject'
 import { MarkdownService } from '../../shared'
 import truncate from 'lodash-es/truncate'
@@ -59,6 +60,10 @@ export class VideoDescriptionComponent implements ControlValueAccessor, OnInit {
     this.descriptionChanged.next(this.description)
   }
 
+  arePreviewsDisplayed () {
+    return isInMobileView() === false
+  }
+
   private updateDescriptionPreviews () {
     if (!this.description) return
 
index 82c4bca7438947d96f35a981b50d8655cac9a42d..5363b759b174838e02eca55c41e883dabc1bdf2e 100644 (file)
@@ -312,7 +312,7 @@ p-datatable {
     .tab-link {
       display: flex !important;
       align-items: center;
-      height: 30px !important;
+      min-height: 30px !important;
       padding: 0 15px;
     }
 
@@ -373,8 +373,8 @@ table {
 
     &, &.expanded {
       .margin-content {
-        margin-left: 10px;
-        margin-right: 10px;
+        margin-left: 15px;
+        margin-right: 15px;
       }
 
       .sub-menu {
index 1237e675d4c0be6775c4e4eb1e3ffa54a726c9b0..eb3b1d2834cd1821d8848528c96cf7d28dcd386b 100644 (file)
     font-weight: $font-regular;
     margin-left: 5px;
     cursor: pointer;
+    display: inline;
   }
 }