Project

General

Profile

« Previous | Next » 

Revision 60985

[Trunk | Connect]:
1. invite.component.ts: [Bug fix] Set meta (canonical url, url, title, description) only when "longView == true" (when we are on invite page, not just calling invite component).
2. browse-community.component.ts: Added method "_formatDescription()" which calls method "StringUtils.HTMLToString()" and then it cuts description up to a threshold (max chars).
3. browse-community.component.html: Removed tooltip from description and "_formatDescription()" is called to show description.

View differences:

browse-community.component.ts
7 7
import {LocalStorageService} from "../../openaireLibrary/services/localStorage.service";
8 8
import {Subscriber} from "rxjs";
9 9
import {properties} from "../../../environments/environment";
10
import {StringUtils} from "../../openaireLibrary/utils/string-utils.class";
10 11

  
11 12
@Component({
12 13
  selector: 'browse-community',
......
99 100
      window.open(url, '_blank');
100 101
    }
101 102
  }
103

  
104
  public _formatDescription(description) {
105
    let descr: string = StringUtils.HTMLToString(description);
106
    return (((descr).length > this.thresholdDescription) ? (descr.substring(0, (this.thresholdDescription - ('...').length)) + "...") : descr);
107
  }
102 108
}

Also available in: Unified diff