From 6693df9dd60e6966186bcb7765218596de7b65c0 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 31 Jan 2018 10:42:01 +0100 Subject: [PATCH] Hide description previews on mobile view --- client/src/app/+admin/jobs/shared/job.service.ts | 2 +- .../account-settings/account-settings.component.scss | 1 + client/src/app/app.component.ts | 5 +++-- .../+video-edit/shared/video-description.component.html | 2 +- .../+video-edit/shared/video-description.component.ts | 5 +++++ client/src/sass/application.scss | 6 +++--- client/src/sass/include/_mixins.scss | 1 + 7 files changed, 15 insertions(+), 7 deletions(-) diff --git a/client/src/app/+admin/jobs/shared/job.service.ts b/client/src/app/+admin/jobs/shared/job.service.ts index a19d278c9..1c0915b5e 100644 --- a/client/src/app/+admin/jobs/shared/job.service.ts +++ b/client/src/app/+admin/jobs/shared/job.service.ts @@ -25,7 +25,7 @@ export class JobService { params = this.restService.addRestGetParams(params, pagination, sort) return this.authHttp.get>(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)) } diff --git a/client/src/app/account/account-settings/account-settings.component.scss b/client/src/app/account/account-settings/account-settings.component.scss index aaf9d79f0..1cc00ca49 100644 --- a/client/src/app/account/account-settings/account-settings.component.scss +++ b/client/src/app/account/account-settings/account-settings.component.scss @@ -26,6 +26,7 @@ @include peertube-button-file(160px); margin-top: 10px; + margin-bottom: 5px; } .file-max-size { diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index 584640290..d2678096f 100644 --- a/client/src/app/app.component.ts +++ b/client/src/app/app.component.ts @@ -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 } } diff --git a/client/src/app/videos/+video-edit/shared/video-description.component.html b/client/src/app/videos/+video-edit/shared/video-description.component.html index 5d05467be..989292c47 100644 --- a/client/src/app/videos/+video-edit/shared/video-description.component.html +++ b/client/src/app/videos/+video-edit/shared/video-description.component.html @@ -3,7 +3,7 @@ id="description" name="description"> - + diff --git a/client/src/app/videos/+video-edit/shared/video-description.component.ts b/client/src/app/videos/+video-edit/shared/video-description.component.ts index 34dbc21a6..eba345412 100644 --- a/client/src/app/videos/+video-edit/shared/video-description.component.ts +++ b/client/src/app/videos/+video-edit/shared/video-description.component.ts @@ -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 diff --git a/client/src/sass/application.scss b/client/src/sass/application.scss index 82c4bca74..5363b759b 100644 --- a/client/src/sass/application.scss +++ b/client/src/sass/application.scss @@ -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 { diff --git a/client/src/sass/include/_mixins.scss b/client/src/sass/include/_mixins.scss index 1237e675d..eb3b1d283 100644 --- a/client/src/sass/include/_mixins.scss +++ b/client/src/sass/include/_mixins.scss @@ -259,6 +259,7 @@ font-weight: $font-regular; margin-left: 5px; cursor: pointer; + display: inline; } }