Hide description previews on mobile view

pull/277/head
Chocobozzz 2018-01-31 10:42:01 +01:00
parent 61bbc72775
commit 6693df9dd6
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
7 changed files with 15 additions and 7 deletions

View 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))
}

View File

@ -26,6 +26,7 @@
@include peertube-button-file(160px);
margin-top: 10px;
margin-bottom: 5px;
}
.file-max-size {

View 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
}
}

View 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>

View 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

View 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 {

View File

@ -259,6 +259,7 @@
font-weight: $font-regular;
margin-left: 5px;
cursor: pointer;
display: inline;
}
}