Project

General

Profile

« Previous | Next » 

Revision 60927

[Connect | Trunk]: Add smooth scroll service

View differences:

modules/uoa-connect-portal/trunk/src/app/subjects/subjects.component.ts
96 96
        this.getPageContents();
97 97
        this.subjects = community.subjects;
98 98
        this.showLoading = false;
99
        HelperFunctions.scroll();
100 99
      }
101 100
    }));
102 101
  }
modules/uoa-connect-portal/trunk/src/app/community/community.component.ts
150 150
    this.subs.push(this._communityService.getCommunityAsObservable().subscribe(
151 151
      community => {
152 152
        if(community) {
153
          if (typeof document !== 'undefined') {
154
            HelperFunctions.scroll();
155
          }
156 153
          this.community = community;
157 154
          if (community.description != null && (community.description.length - this.thresholdDescription <= this.descriptionDiff)) {
158 155
            this.thresholdDescription = community.description.length;
modules/uoa-connect-portal/trunk/src/app/searchPages/communities/searchCommunities.component.ts
153 153
        this.handleError('Error getting communities', err);
154 154
        this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
155 155
        this.disableForms = false;
156
        HelperFunctions.scroll();
157 156
      }
158 157
    ));
159 158
  }
modules/uoa-connect-portal/trunk/src/app/statistics/statistics.component.ts
90 90
    this._meta.updateTag({content: url}, "property='og:url'");
91 91
    this.subs.push(this._communityService.getCommunityAsObservable().subscribe(
92 92
      community => {
93
        if (typeof document !== 'undefined') {
94
          HelperFunctions.scroll();
95
        }
96 93
        if(community) {
97 94
          this.communityId = community.communityId;
98 95
          if (this.currentMode == "showInMonitor" && this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
modules/uoa-connect-portal/trunk/src/app/contact/contact.component.ts
70 70
        this.reset();
71 71
        //this.getDivContents();
72 72
        this.getPageContents();
73
        HelperFunctions.scroll();
74 73
        this.showLoading = false;
75 74

  
76 75
    }
modules/uoa-connect-portal/trunk/src/app/utils/subscribe/subscribe.component.ts
26 26
        <a class="uk-alert-close" uk-close></a>
27 27
        <p>Please login first to subscribe</p>
28 28
      </div>
29
      <button *ngIf="loading" class="uk-button portal-button-reverse uk-button-small uk-width-1-1">
29
      <button *ngIf="loading" class="uk-button portal-button uk-button-small uk-width-1-1">
30 30
        <span class="uk-icon"><loading [top_margin]="false" [size]="'small'" [color]="null"></loading></span>
31 31
      </button>
32 32
      <button *ngIf="!subscribed && !loading" class="uk-button portal-button uk-button-small uk-width-1-1"
modules/uoa-connect-portal/trunk/src/app/utils/subscribe/invite/invite.component.ts
171 171
        }
172 172

  
173 173
      }));
174
    HelperFunctions.scroll();
175 174
  }
176 175

  
177 176
  private getPageContents() {
......
200 199
        this.subs.push(this._emailService.sendEmail(this.properties, this.email).subscribe(
201 200
          res => {
202 201
            this.status = this.errorCodes.DONE;
203
            //console.log("Emails Sent: ",res);
204
            /*if(res == 0) {
205

  
206
            } else if(res > 1) {
207
              this.successfulSentMessage = res + " emails sent successfully!";
208
            } else {
209
              this.successfulSentMessage = res + " email sent successfully!";
210
            }*/
211

  
212 202
            if (res['success']) {
213 203
              this.successfulSentMessage = "Email sent successfully to: ";
214 204
              this.successfulSentRecipients = res['success'];
......
240 230
  }
241 231

  
242 232
  public isEmpty(data: string): boolean {
243
    if (data != undefined && !data.replace(/\s/g, '').length)
244
      return true;
245
    else
246
      return false;
233
    return data != undefined && !data.replace(/\s/g, '').length;
247 234
  }
248 235

  
249 236
  public resetMessages() {
......
284 271
  public composeEmail() {
285 272
    this.email.body = Composer.formatEmailBodyForInvitation(this.body);
286 273
  }
287

  
288
  /*
289
    public handleError(error) {
290
      if(error.status == '401') {
291
        this.status = this.errorCodes.FORBIDDEN;
292
      } else if(error.status == '403') {
293
        this.status = this.errorCodes.FORBIDDEN;
294
      } else if(error.status == '404') {
295
        this.status = this.errorCodes.NOT_FOUND;
296
      } else if(error.status == '500') {
297
        this.status = this.errorCodes.ERROR;
298
      } else {
299
        this.status = this.errorCodes.NOT_AVAILABLE;
300
      }
301
        console.log('Server responded: ' + error);
302
    }
303
  */
274
  
304 275
  allowEdit() {
305 276
    if (!this.user) {
306 277
      return false;
modules/uoa-connect-portal/trunk/src/app/curators/curators.component.ts
104 104
        this.showMore[i] = false;
105 105
      }
106 106
      this.showLoading = false;
107
      HelperFunctions.scroll();
108 107
    }));
109 108
  }
110 109
  
modules/uoa-connect-portal/trunk/src/app/app.component.ts
18 18
import {LoginErrorCodes} from "./openaireLibrary/login/utils/guardHelper.class";
19 19
import {CustomizationOptions} from "./openaireLibrary/connect/community/CustomizationOptions";
20 20
import {LayoutService} from "./openaireLibrary/services/layout.service";
21
import {SmoothScroll} from "./openaireLibrary/utils/smooth-scroll";
21 22

  
22 23
@Component({
23 24
  //changeDetection: ChangeDetectionStrategy.Default,
......
102 103
  subscriptions = [];
103 104
  layout: CustomizationOptions = null;
104 105
  constructor(private  route: ActivatedRoute, private propertiesService: EnvironmentSpecificService,
105
              private _communitiesService: CommunitiesService,
106
              private _communitiesService: CommunitiesService, private smoothScroll: SmoothScroll,
106 107
              private router: Router, private userManagementService: UserManagementService,
107 108
              private configurationService: ConfigurationService, private _communityService: CommunityService, private _layoutService: LayoutService) {
108
    this.subscriptions.push(router.events.forEach((event) => {
109
      if (event instanceof NavigationStart) {
110
        HelperFunctions.scroll();
111
      }
112
    }));
113 109
  }
114 110
  
115 111
  ngOnDestroy() {
......
122 118
    this.userManagementService.clearSubscriptions();
123 119
    this.configurationService.clearSubscriptions();
124 120
    this._communityService.clearSubscriptions();
121
    this.smoothScroll.clearSubscriptions();
125 122
  }
126 123
  
127 124
  ngOnInit() {
modules/uoa-connect-portal/trunk/src/app/deposit/zenodo/shareInZenodo.component.ts
93 93
          }
94 94
          this.community = community;
95 95
          this.masterZenodoCommunityId = this.community.zenodoCommunity;
96
          if (typeof document !== 'undefined') {
97
            HelperFunctions.scroll();
98
          }
99 96
          if (this.masterZenodoCommunityId) {
100 97
            this.subs.push(this._zenodoCommunitieService.getZenodoCommunityById(this.properties, this.properties.zenodoCommunities + this.masterZenodoCommunityId, null).subscribe(
101 98
              result => {
modules/uoa-connect-portal/trunk/src/app/app-routing.module.ts
1 1
import {NgModule} from '@angular/core';
2
import {RouterModule, Routes} from '@angular/router';
2
import {PreloadAllModules, RouterModule, Routes} from '@angular/router';
3 3
import {OpenaireErrorPageComponent} from './error/errorPage.component';
4 4
import {PageURLResolverComponent} from "./openaireLibrary/utils/pageURLResolver.component";
5 5
import {IsCommunity} from "./openaireLibrary/connect/communityGuard/isCommunity.guard";
......
213 213
];
214 214

  
215 215
@NgModule({
216
  imports: [RouterModule.forRoot(routes)],
216
  imports: [RouterModule.forRoot(routes, {
217
    preloadingStrategy: PreloadAllModules,
218
    onSameUrlNavigation: "reload",
219
    relativeLinkResolution: 'corrected'
220
  })],
217 221
  exports: [RouterModule]
218 222
})
219 223
export class AppRoutingModule {

Also available in: Unified diff