Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

Commit 0d73e8c

Browse files
code: replace deprecated jQuery usages
1 parent d1156ec commit 0d73e8c

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

‎demo/src/app/base-demo/base-demo.component.ts‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Component, Input, OnInit, TemplateRef } from '@angular/core';
22

33
// needed to re-init tabs on route change
4-
declare var $: any;
4+
declare var $: JQueryStatic;
55

66
@Component({
77
selector: 'app-base-demo',
@@ -45,19 +45,16 @@ export class BaseDemoComponent implements OnInit {
4545
$('#toTop').fadeOut();
4646
}
4747
}
48+
4849
initBackToTop() {
4950
// hide scroll button on page load
50-
$().ready(this.scrollCallback);
51+
$(this.scrollCallback);
5152
// scroll handler
52-
$(window).scroll(this.scrollCallback);
53+
$(window).on('scroll',this.scrollCallback);
5354

5455
$("#toTop").on('click', function () {
5556
$("html, body").animate({ scrollTop: 0 }, 1000);
5657
});
5758
}
5859

59-
scrollToElement(element: HTMLElement): void {
60-
element.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'nearest' });
61-
}
62-
6360
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /