Project

General

Profile

« Previous | Next » 

Revision 55571

[Branch|newlinking]
Merging trunk into branch newlinking 55133:55568

View differences:

invite.component.ts
16 16
import {ErrorCodes}                                      from '../../../openaireLibrary/utils/properties/errorCodes';
17 17
import {ErrorMessagesComponent}                          from '../../../openaireLibrary/utils/errorMessages.component';
18 18
import {Session}                                         from '../../../openaireLibrary/login/utils/helper.class';
19
import {HelperFunctions} from "../../../openaireLibrary/utils/HelperFunctions.class";
19 20

  
20 21
@Component({
21 22
    selector: 'invite',
......
26 27

  
27 28
  @Input() longView: boolean = true;
28 29
  @Input() communityId = null;
30
  @Input() buttonSizeSmall = true;
29 31

  
30 32
  private properties: EnvProperties = null;
31 33

  
......
58 60
  private errorMessages: ErrorMessagesComponent;
59 61

  
60 62
  constructor (
61
      private element: ElementRef,
62 63
      private route: ActivatedRoute,
63 64
      private _router: Router,
64 65
      public _fb: FormBuilder,
......
111 112

  
112 113
            });
113 114

  
114
          this.scroll();
115
        HelperFunctions.scroll();
115 116
      });
116 117
  }
117 118

  
118
  public scroll() {
119
    if (typeof document !== 'undefined') {
120
       this.element.nativeElement.scrollIntoView();
121
    }
122
  }
123 119

  
124 120
  public invite() {
125 121
      this.successfulSentMessage = "";
126 122
      this.failureSentMessage = "";
127 123
      this.inviteErrorMessage = "";
128 124
      this.status = this.errorCodes.LOADING;
129
      this.scroll();
125
    HelperFunctions.scroll();
130 126
      if (!this.isEmpty(this.recipients) && this.body.fromName != "") {
131 127
        if (this.validateEmails()) {
132 128
          this.composeEmail();
......
173 169
      }
174 170
  }
175 171

  
176
  private isEmpty(data: string): boolean {
172
  public isEmpty(data: string): boolean {
177 173
      if (data != undefined && !data.replace(/\s/g, '').length)
178 174
          return true;
179 175
        else

Also available in: Unified diff