Project

General

Profile

« Previous | Next » 

Revision 60984

[Trunk | Library]:
1. newSearchPage.component.ts: [Bug fix] Initialize properties (Envproperties) in field definition, not in ngOnInit method (when parent called a method that needs property, may had not been initialized).
2. portal-search-result.component.html: Removed tooltip from description.
3. portal-search-result.component.ts: In method "_formatDescription()" call method "StringUtils.HTMLToString()" before cutting it.

View differences:

modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/searchUtils/portal-search-result.component.html
105 105
          </span>
106 106
          </div>
107 107
          <div *ngIf="result.description">
108
            <div class="text-justify descriptionText uk-text-small uk-text-muted uk-margin-auto-right"
109
                 [title]="result.description">
108
            <div class="text-justify descriptionText uk-text-small uk-text-muted uk-margin-auto-right">
109
<!--                 [title]="result.description">-->
110 110
              {{_formatDescription(result.description)}}
111 111
            </div>
112 112
          </div>
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/searchUtils/newSearchPage.component.ts
100 100
  public pagingLimit: number = 0;
101 101
  public resultsPerPage: number = 0;
102 102
  isPiwikEnabled = false;
103
  properties: EnvProperties;
103
  properties: EnvProperties = properties;
104 104
  public pageContents = null;
105 105
  public divContents = null;
106 106
  public routerHelper: RouterHelper = new RouterHelper();
......
138 138
  }
139 139

  
140 140
  ngOnInit() {
141
      this.properties = properties;
141
      // this.properties = properties;
142 142
      //this.getDivContents();
143 143
      this.getPageContents();
144 144
      this.pagingLimit = this.properties.pagingLimit;
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/searchUtils/portal-search-result.component.ts
6 6
import {Router} from "@angular/router";
7 7
import {LocalStorageService} from "../../services/localStorage.service";
8 8
import {Stakeholder, StakeholderInfo} from "../../monitor/entities/stakeholder";
9
import {StringUtils} from "../../utils/string-utils.class";
9 10

  
10 11
@Component({
11 12
  selector: 'portal-search-result',
......
61 62
  }
62 63
  
63 64
  public _formatDescription(description) {
64
    return (((description).length > this.maxCharacters) ? (description.substring(0, (this.maxCharacters - ('...').length)) + "...") : description);
65
    let descr: string = StringUtils.HTMLToString(description);
66
    return (((descr).length > this.maxCharacters) ? (descr.substring(0, (this.maxCharacters - ('...').length)) + "...") : descr);
65 67
  }
66 68
  
67 69
  public confirmModalOpen(result: CommunityInfo & Stakeholder) {

Also available in: Unified diff