Project

General

Profile

« Previous | Next » 

Revision 55059

[Trunk|Library]: In Landing Pages: cut description up to 270 characters and add 'view more/less' functionality.

View differences:

orp.component.ts
29 29
    public showAllDownloadFrom: boolean = false;
30 30
    public showAllPublishedIn: boolean = false;
31 31

  
32
    public thresholdDescription: number = 270;
33
    public showNumDescription: number = 270;
34
    
32 35
    // Metrics tab variables
33 36
    public metricsClicked: boolean;
34 37
    public viewsFrameUrl: string;
......
95 98

  
96 99
            this.downloadsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resRepoDownloads", "resTitle":"'+this.orpId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
97 100

  
98
            if (typeof document !== 'undefined') {
99
               this.element.nativeElement.scrollIntoView();
100
            }
101
            this.scroll();
101 102
        });
102 103

  
103 104
    }
......
187 188
      return Array.from(map.keys());
188 189
    }
189 190

  
191
    public scroll() {
192
      if (typeof document !== 'undefined') {
193
         this.element.nativeElement.scrollIntoView();
194
      }
195
    }
196

  
190 197
    private handleError(message: string, error) {
191 198
        console.error("Other Research Product Landing Page: "+message, error);
192 199
    }

Also available in: Unified diff