show popout conditionals

This commit is contained in:
Kyle Spearrin 2018-04-11 10:48:48 -04:00
parent 45033eb81e
commit 1e3a82586a
5 changed files with 16 additions and 8 deletions

View File

@ -1,3 +1,5 @@
<button (click)="expand()" title="{{'popOutNewWindow' | i18n}}">
<i class="fa fa-external-link fa-rotate-270 fa-lg fa-fw"></i>
</button>
<ng-container *ngIf="show">
<button (click)="expand()" title="{{'popOutNewWindow' | i18n}}">
<i class="fa fa-external-link fa-rotate-270 fa-lg fa-fw"></i>
</button>
</ng-container>

View File

@ -1,4 +1,7 @@
import { Component } from '@angular/core';
import {
Component,
Input,
} from '@angular/core';
import { Angulartics2 } from 'angulartics2';
@ -13,8 +16,12 @@ import { PopupUtilsService } from '../services/popup-utils.service';
templateUrl: 'pop-out.component.html',
})
export class PopOutComponent {
@Input() show = true;
constructor(private analytics: Angulartics2, private platformUtilsService: PlatformUtilsService,
private popupUtilsService: PopupUtilsService) { }
private popupUtilsService: PopupUtilsService) {
this.show = !this.platformUtilsService.isSafari();
}
expand() {
this.analytics.eventTrack.next({ action: 'Pop Out Window' });

View File

@ -1,5 +1,6 @@
<header>
<div class="left">
<app-pop-out [show]="!showSelect"></app-pop-out>
<button type="button" appBlurClick (click)="close()" *ngIf="showSelect">{{'cancel' | i18n}}</button>
</div>
<div class="center">

View File

@ -1,6 +1,6 @@
<header>
<div class="left">
<app-pop-out *ngIf="showPopout"></app-pop-out>
<app-pop-out [show]="!inSidebar"></app-pop-out>
<button type="button" appBlurClick (click)="refresh()" title="{{'refresh' | i18n}}" *ngIf="inSidebar">
<i class="fa fa-refresh fa-lg fa-fw"></i>
</button>

View File

@ -43,7 +43,6 @@ export class CurrentTabComponent implements OnInit, OnDestroy {
searchText: string;
canAutofill = false;
inSidebar = false;
showPopout = true;
disableSearch = false;
loaded = false;
loadedTimeout: number;
@ -55,7 +54,6 @@ export class CurrentTabComponent implements OnInit, OnDestroy {
private ngZone: NgZone, private broadcasterService: BroadcasterService,
private changeDetectorRef: ChangeDetectorRef, private syncService: SyncService) {
this.inSidebar = popupUtilsService.inSidebar(window);
this.showPopout = !this.inSidebar && !platformUtilsService.isSafari();
this.disableSearch = platformUtilsService.isEdge();
}