Commit cf032391 authored by Marcelo Rivera's avatar Marcelo Rivera
Browse files

(fix): added documentation

(fix): cleanup
parent 1bc00288
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -18,11 +18,12 @@
      <i
      <i
        *ngIf="attachment.shouldBeBlurred(entity)"
        *ngIf="attachment.shouldBeBlurred(entity)"
        class="material-icons mature-icon"
        class="material-icons mature-icon"
        >explicit</i
      >
      <i *ngIf="isUnlisted(entity)" class="material-icons unlisted-icon"
        >visibility_off</i
      >
      >
        explicit
      </i>
      <i *ngIf="isUnlisted(entity)" class="material-icons unlisted-icon">
        visibility_off
      </i>
    </a>
    </a>
  </ng-container>
  </ng-container>
</div>
</div>
+9 −16
Original line number Original line Diff line number Diff line
@@ -17,8 +17,7 @@ export class NewsfeedTilesComponent {
  constructor(
  constructor(
    public attachment: AttachmentService,
    public attachment: AttachmentService,
    private router: Router,
    private router: Router,
    private overlayModalService: OverlayModalService,
    private overlayModalService: OverlayModalService
    private featuresService: FeaturesService
  ) {}
  ) {}


  getThumbnailSrc(entity: any) {
  getThumbnailSrc(entity: any) {
@@ -48,7 +47,11 @@ export class NewsfeedTilesComponent {
    return entity && (entity.access_id === '0' || entity.access_id === 0);
    return entity && (entity.access_id === '0' || entity.access_id === 0);
  }
  }


  clickedImage(entity: any, batchImage) {
  /**
   * @param entity
   * @param batchImage the image element where the user clicked
   */
  clickedImage(entity: any, batchImage: HTMLImageElement) {
    const isNotTablet = Math.min(screen.width, screen.height) < 768;
    const isNotTablet = Math.min(screen.width, screen.height) < 768;
    const pageUrl = `/media/${entity.entity_guid}`;
    const pageUrl = `/media/${entity.entity_guid}`;


@@ -57,21 +60,11 @@ export class NewsfeedTilesComponent {
      return;
      return;
    }
    }


    if (!this.featuresService.has('media-modal')) {
      this.router.navigate([pageUrl]);
      return;
    } else {
    if (entity.width === '0' || entity.height === '0') {
    if (entity.width === '0' || entity.height === '0') {
      this.setImageDimensions(entity, batchImage);
      this.setImageDimensions(entity, batchImage);
    }
    }
    this.openModal(entity);
    this.openModal(entity);
  }
  }
  }

  // setVideoDimensions($event) {
  //   this.videoDimensions = $event.dimensions;
  //   entity.custom_data.dimensions = videoDimensions;
  // }


  setImageDimensions(entity, imageElement: HTMLImageElement) {
  setImageDimensions(entity, imageElement: HTMLImageElement) {
    const img: HTMLImageElement = imageElement;
    const img: HTMLImageElement = imageElement;